From 7c5e9bf73a090a862e7d2950f9f848d4f870d012 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Sat, 13 Oct 2018 17:58:24 +0200 Subject: [PATCH] Add stairsplus support from moreblocks --- seacobble/depends.txt | 3 ++- seacobble/init.lua | 36 +++++++++++++++++++++++++++--------- seaglass/depends.txt | 3 ++- seaglass/init.lua | 3 +-- seagravel/depends.txt | 3 ++- seagravel/init.lua | 36 +++++++++++++++++++++++++++--------- seastone/depends.txt | 3 ++- seastone/init.lua | 36 +++++++++++++++++++++++++++--------- seastonebrick/depends.txt | 3 ++- seastonebrick/init.lua | 36 +++++++++++++++++++++++++++--------- 10 files changed, 119 insertions(+), 43 deletions(-) diff --git a/seacobble/depends.txt b/seacobble/depends.txt index 257d73b..525967b 100644 --- a/seacobble/depends.txt +++ b/seacobble/depends.txt @@ -3,4 +3,5 @@ dye stairs clams whiteshell? -colormachine? \ No newline at end of file +colormachine? +moreblocks? diff --git a/seacobble/init.lua b/seacobble/init.lua index dee0081..4293edf 100644 --- a/seacobble/init.lua +++ b/seacobble/init.lua @@ -60,56 +60,74 @@ minetest.register_node("seacobble:seacobble_redviolet", { -- STAIRS +local colors = {"", "cyan", "magenta", "lime", "aqua", "skyblue", "redviolet"} -stairs.register_stair_and_slab("seacobble", "seacobble:seacobble", +if minetest.get_modpath("moreblocks") then + for i, color in ipairs(colors) do + local c = "_"..color + if i == 1 then c = "" end + local nodename = "seacobble:seacobble"..c + local ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + ndef.place_param2 = nil + + stairsplus:register_all( + "seacobble", + "seacobble"..c, + nodename, + ndef + ) + end +else + stairs.register_stair_and_slab("seacobble", "seacobble:seacobble", {cracky=3, stone=2}, {"seacobble_seacobble.png"}, "Seacobble stair", "Seacobble slab", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_cyan", "seacobble:seacobble_cyan", + stairs.register_stair_and_slab("seacobble_cyan", "seacobble:seacobble_cyan", {cracky=3, stone=2}, {"seacobble_seacobble_cyan.png"}, "Seacobble stair cyan", "Seacobble slab cyan", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_magenta", "seacobble:seacobble_magenta", + stairs.register_stair_and_slab("seacobble_magenta", "seacobble:seacobble_magenta", {cracky=3, stone=2}, {"seacobble_seacobble_magenta.png"}, "Seacobble stair magenta", "Seacobble slab magenta", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_lime", "seacobble:seacobble_lime", + stairs.register_stair_and_slab("seacobble_lime", "seacobble:seacobble_lime", {cracky=3, stone=2}, {"seacobble_seacobble_lime.png"}, "Seacobble stair lime", "Seacobble slab lime", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_aqua", "seacobble:seacobble_aqua", + stairs.register_stair_and_slab("seacobble_aqua", "seacobble:seacobble_aqua", {cracky=3, stone=2}, {"seacobble_seacobble_aqua.png"}, "Seacobble stair aqua", "Seacobble slab aqua", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_skyblue", "seacobble:seacobble_skyblue", + stairs.register_stair_and_slab("seacobble_skyblue", "seacobble:seacobble_skyblue", {cracky=3, stone=2}, {"seacobble_seacobble_skyblue.png"}, "Seacobble stair skyblue ", "Seacobble slab skyblue", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seacobble_redviolet", "seacobble:seacobble_redviolet", + stairs.register_stair_and_slab("seacobble_redviolet", "seacobble:seacobble_redviolet", {cracky=3, stone=2}, {"seacobble_seacobble_redviolet.png"}, "Seacobble stair redviolet", "Seacobble slab redviolet", default.node_sound_stone_defaults()) - +end -- CRAFTING @@ -136,4 +154,4 @@ register_seacobble_craft("seacobble:seacobble_magenta", {'clams:crushedwhite', ' register_seacobble_craft("seacobble:seacobble_lime", {'clams:crushedwhite', 'default:cobble','dye:lime'}) register_seacobble_craft("seacobble:seacobble_aqua", {'clams:crushedwhite', 'default:cobble','dye:aqua'}) register_seacobble_craft("seacobble:seacobble_skyblue", {'clams:crushedwhite', 'default:cobble','dye:skyblue'}) -register_seacobble_craft("seacobble:seacobble_redviolet", {'clams:crushedwhite', 'default:cobble','dye:redviolet'}) \ No newline at end of file +register_seacobble_craft("seacobble:seacobble_redviolet", {'clams:crushedwhite', 'default:cobble','dye:redviolet'}) diff --git a/seaglass/depends.txt b/seaglass/depends.txt index 5ceae13..1af68bd 100644 --- a/seaglass/depends.txt +++ b/seaglass/depends.txt @@ -3,4 +3,5 @@ dye stairs clams stairsshine -colormachine? \ No newline at end of file +colormachine? +moreblocks? diff --git a/seaglass/init.lua b/seaglass/init.lua index 6e8deba..396ed81 100644 --- a/seaglass/init.lua +++ b/seaglass/init.lua @@ -160,7 +160,6 @@ minetest.register_node("seaglass:seaglassoff_black", { -- STAIRS - stairsshine.register_stair_and_slab("seaglass", "seaglass:seaglass", {snappy=2,cracky=3,oddly_breakable_by_hand=3, nocolor=1, shine=1, not_in_creative_inventory=1}, {"seaglass_seaglass.png"}, @@ -738,4 +737,4 @@ minetest.register_alias("clams:yellowlightglass","seaglass:seaglassoff_yellow") minetest.register_alias("clams:redlightglass","seaglass:seaglassoff_red") minetest.register_alias("clams:bluelightglass","seaglass:seaglassoff_blue") minetest.register_alias("clams:whitelightglass","seaglass:seaglassoff_white") -minetest.register_alias("clams:blacklightglass","seaglass:seaglassoff_black") \ No newline at end of file +minetest.register_alias("clams:blacklightglass","seaglass:seaglassoff_black") diff --git a/seagravel/depends.txt b/seagravel/depends.txt index 257d73b..525967b 100644 --- a/seagravel/depends.txt +++ b/seagravel/depends.txt @@ -3,4 +3,5 @@ dye stairs clams whiteshell? -colormachine? \ No newline at end of file +colormachine? +moreblocks? diff --git a/seagravel/init.lua b/seagravel/init.lua index 53472c0..e5ef76d 100644 --- a/seagravel/init.lua +++ b/seagravel/init.lua @@ -81,8 +81,26 @@ minetest.register_node("seagravel:seagravel_redviolet", { -- STAIRS +local colors = {"", "cyan", "magenta", "lime", "aqua", "skyblue", "redviolet"} -stairs.register_stair_and_slab("seagravel", "seagravel:seagravel", +if minetest.get_modpath("moreblocks") then + for i, color in ipairs(colors) do + local c = "_"..color + if i == 1 then c = "" end + local nodename = "seagravel:seagravel"..c + local ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + ndef.place_param2 = nil + + stairsplus:register_all( + "seagravel", + "seagravel"..c, + nodename, + ndef + ) + end +else + stairs.register_stair_and_slab("seagravel", "seagravel:seagravel", {crumbly=2, falling_node=1}, {"seagravel_seagravel.png"}, "Seagravel stair", @@ -92,7 +110,7 @@ stairs.register_stair_and_slab("seagravel", "seagravel:seagravel", dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan", + stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan", {crumbly=2, falling_node=1}, {"seagravel_seagravel_cyan.png"}, "Seagravel stair cyan", @@ -102,7 +120,7 @@ stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan", dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta", + stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta", {crumbly=2, falling_node=1}, {"seagravel_seagravel_magenta.png"}, "Seagravel stair magenta", @@ -112,7 +130,7 @@ stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime", + stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime", {cracky=3, stone=2}, {"seagravel_seagravel_lime.png"}, "Seagravel stair lime", @@ -122,7 +140,7 @@ stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime", dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua", + stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua", {crumbly=2, falling_node=1}, {"seagravel_seagravel_aqua.png"}, "Seagravel stair aqua", @@ -132,7 +150,7 @@ stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua", dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue", + stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue", {crumbly=2, falling_node=1}, {"seagravel_seagravel_skyblue.png"}, "Seagravel stair skyblue ", @@ -142,7 +160,7 @@ stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue dug = {name="default_gravel_footstep", gain=1.0}, })) -stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redviolet", + stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redviolet", {crumbly=2, falling_node=1}, {"seagravel_seagravel_redviolet.png"}, "Seagravel stair redviolet", @@ -151,7 +169,7 @@ stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redvi footstep = {name="default_gravel_footstep", gain=0.5}, dug = {name="default_gravel_footstep", gain=1.0}, })) - +end -- CRAFTING @@ -178,4 +196,4 @@ register_seagravel_craft("seagravel:seagravel_magenta", {'clams:crushedwhite', ' register_seagravel_craft("seagravel:seagravel_lime", {'clams:crushedwhite', 'default:gravel','dye:lime'}) register_seagravel_craft("seagravel:seagravel_aqua", {'clams:crushedwhite', 'default:gravel','dye:aqua'}) register_seagravel_craft("seagravel:seagravel_skyblue", {'clams:crushedwhite', 'default:gravel','dye:skyblue'}) -register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'}) \ No newline at end of file +register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'}) diff --git a/seastone/depends.txt b/seastone/depends.txt index 257d73b..525967b 100644 --- a/seastone/depends.txt +++ b/seastone/depends.txt @@ -3,4 +3,5 @@ dye stairs clams whiteshell? -colormachine? \ No newline at end of file +colormachine? +moreblocks? diff --git a/seastone/init.lua b/seastone/init.lua index bfbf9c0..48c44c1 100644 --- a/seastone/init.lua +++ b/seastone/init.lua @@ -67,56 +67,74 @@ minetest.register_node("seastone:seastone_redviolet", { -- STAIRS +local colors = {"", "cyan", "magenta", "lime", "aqua", "skyblue", "redviolet"} -stairs.register_stair_and_slab("seastone", "seastone:seastone", +if minetest.get_modpath("moreblocks") then + for i, color in ipairs(colors) do + local c = "_"..color + if i == 1 then c = "" end + local nodename = "seastone:seastone"..c + local ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + ndef.place_param2 = nil + + stairsplus:register_all( + "seastone", + "seastone"..c, + nodename, + ndef + ) + end +else + stairs.register_stair_and_slab("seastone", "seastone:seastone", {cracky=3, stone=1}, {"seastone_seastone.png"}, "Seastone stair", "Seastone slab", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_cyan", "seastone:seastone_cyan", + stairs.register_stair_and_slab("seastone_cyan", "seastone:seastone_cyan", {cracky=3, stone=1}, {"seastone_seastone_cyan.png"}, "Seastone stair cyan", "Seastone slab cyan", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_magenta", "seastone:seastone_magenta", + stairs.register_stair_and_slab("seastone_magenta", "seastone:seastone_magenta", {cracky=3, stone=1}, {"seastone_seastone_magenta.png"}, "Seastone stair magenta", "Seastone slab magenta", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_lime", "seastone:seastone_lime", + stairs.register_stair_and_slab("seastone_lime", "seastone:seastone_lime", {cracky=3, stone=1}, {"seastone_seastone_lime.png"}, "Seastone stair lime", "Seastone slab lime", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_aqua", "seastone:seastone_aqua", + stairs.register_stair_and_slab("seastone_aqua", "seastone:seastone_aqua", {cracky=3, stone=1}, {"seastone_seastone_aqua.png"}, "Seastone stair aqua", "Seastone slab aqua", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_skyblue", "seastone:seastone_skyblue", + stairs.register_stair_and_slab("seastone_skyblue", "seastone:seastone_skyblue", {cracky=3, stone=1}, {"seastone_seastone_skyblue.png"}, "Seastone stair skyblue ", "Seastone slab skyblue", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastone_redviolet", "seastone:seastone_redviolet", + stairs.register_stair_and_slab("seastone_redviolet", "seastone:seastone_redviolet", {cracky=3, stone=1}, {"seastone_seastone_redviolet.png"}, "Seastone stair redviolet", "Seastone slab redviolet", default.node_sound_stone_defaults()) - +end -- CRAFTING @@ -162,4 +180,4 @@ register_smoothblock_cooking("seastone:seastone_magenta", "seacobble:seacobble_m register_smoothblock_cooking("seastone:seastone_lime", "seacobble:seacobble_lime") register_smoothblock_cooking("seastone:seastone_aqua", "seacobble:seacobble_aqua") register_smoothblock_cooking("seastone:seastone_skyblue", "seacobble:seacobble_skyblue") -register_smoothblock_cooking("seastone:seastone_redviolet", "seacobble:seacobble_redviolet") \ No newline at end of file +register_smoothblock_cooking("seastone:seastone_redviolet", "seacobble:seacobble_redviolet") diff --git a/seastonebrick/depends.txt b/seastonebrick/depends.txt index 8a60af6..faa2dcb 100644 --- a/seastonebrick/depends.txt +++ b/seastonebrick/depends.txt @@ -1,4 +1,5 @@ default stairs seastone -colormachine? \ No newline at end of file +colormachine? +moreblocks? diff --git a/seastonebrick/init.lua b/seastonebrick/init.lua index e026413..0a349a3 100644 --- a/seastonebrick/init.lua +++ b/seastonebrick/init.lua @@ -61,56 +61,74 @@ minetest.register_node("seastonebrick:seastonebrick_redviolet", { -- STAIRS +local colors = {"", "cyan", "magenta", "lime", "aqua", "skyblue", "redviolet"} -stairs.register_stair_and_slab("seastonebrick", "seastonebrick:seastonebrick", +if minetest.get_modpath("moreblocks") then + for i, color in ipairs(colors) do + local c = "_"..color + if i == 1 then c = "" end + local nodename = "seastonebrick:seastonebrick"..c + local ndef = table.copy(minetest.registered_nodes[nodename]) + ndef.sunlight_propagates = true + ndef.place_param2 = nil + + stairsplus:register_all( + "seastonebrick", + "seastonebrick"..c, + nodename, + ndef + ) + end +else + stairs.register_stair_and_slab("seastonebrick", "seastonebrick:seastonebrick", {cracky=3, stone=1}, {"seastonebrick_seastonebrick.png"}, "Seastonebrick stair", "Seastonebrick slab", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_cyan", "seastonebrick:seastonebrick_cyan", + stairs.register_stair_and_slab("seastonebrick_cyan", "seastonebrick:seastonebrick_cyan", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_cyan.png"}, "Seastonebrick stair cyan", "Seastonebrick slab cyan", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_magenta", "seastonebrick:seastonebrick_magenta", + stairs.register_stair_and_slab("seastonebrick_magenta", "seastonebrick:seastonebrick_magenta", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_magenta.png"}, "Seastonebrick stair magenta", "Seastonebrick slab magenta", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_lime", "seastonebrick:seastonebrick_lime", + stairs.register_stair_and_slab("seastonebrick_lime", "seastonebrick:seastonebrick_lime", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_lime.png"}, "Seastonebrick stair lime", "Seastonebrick slab lime", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_aqua", "seastonebrick:seastonebrick_aqua", + stairs.register_stair_and_slab("seastonebrick_aqua", "seastonebrick:seastonebrick_aqua", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_aqua.png"}, "Seastonebrick stair aqua", "Seastonebrick slab aqua", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_skyblue", "seastonebrick:seastonebrick_skyblue", + stairs.register_stair_and_slab("seastonebrick_skyblue", "seastonebrick:seastonebrick_skyblue", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_skyblue.png"}, "Seastonebrick stair skyblue ", "Seastonebrick slab skyblue", default.node_sound_stone_defaults()) -stairs.register_stair_and_slab("seastonebrick_redviolet", "seastonebrick:seastonebrick_redviolet", + stairs.register_stair_and_slab("seastonebrick_redviolet", "seastonebrick:seastonebrick_redviolet", {cracky=3, stone=1}, {"seastonebrick_seastonebrick_redviolet.png"}, "Seastonebrick stair redviolet", "Seastonebrick slab redviolet", default.node_sound_stone_defaults()) - +end -- CRAFTING @@ -128,4 +146,4 @@ register_blockbrick_craft("seastonebrick:seastonebrick_magenta", {{'seastone:sea register_blockbrick_craft("seastonebrick:seastonebrick_lime", {{'seastone:seastone_lime', 'seastone:seastone_lime'}, {'seastone:seastone_lime', 'seastone:seastone_lime'}}) register_blockbrick_craft("seastonebrick:seastonebrick_aqua", {{'seastone:seastone_aqua', 'seastone:seastone_aqua'}, {'seastone:seastone_aqua', 'seastone:seastone_aqua'}}) register_blockbrick_craft("seastonebrick:seastonebrick_skyblue", {{'seastone:seastone_skyblue', 'seastone:seastone_skyblue'}, {'seastone:seastone_skyblue', 'seastone:seastone_skyblue'}}) -register_blockbrick_craft("seastonebrick:seastonebrick_redviolet", {{'seastone:seastone_redviolet', 'seastone:seastone_redviolet'}, {'seastone:seastone_redviolet', 'seastone:seastone_redviolet'}}) \ No newline at end of file +register_blockbrick_craft("seastonebrick:seastonebrick_redviolet", {{'seastone:seastone_redviolet', 'seastone:seastone_redviolet'}, {'seastone:seastone_redviolet', 'seastone:seastone_redviolet'}})