From a08266f87226cbea73e2eaa9a4a3de4814980500 Mon Sep 17 00:00:00 2001 From: Infinatum Date: Sat, 21 Feb 2015 15:07:34 +0000 Subject: [PATCH] Mod Update to 1.0 --- functions.lua | 4 +- init.lua | 328 ++++++++++++++++++++++++++++-- textures/scaffolding_platform.png | Bin 0 -> 2918 bytes 3 files changed, 309 insertions(+), 23 deletions(-) create mode 100644 textures/scaffolding_platform.png diff --git a/functions.lua b/functions.lua index 14b8c7e..ffe7719 100644 --- a/functions.lua +++ b/functions.lua @@ -1,4 +1,4 @@ -scaffolding_nodenames={"scaffolding:scaffolding"} +scaffolding_nodenames={"scaffolding:scaffolding","scaffolding:iron_scaffolding"} minetest.register_on_dignode(function(pos, node) local i=1 @@ -15,7 +15,7 @@ minetest.register_on_dignode(function(pos, node) end end) -iron_scaffolding_nodenames={"scaffolding:iron_scaffolding"} +iron_scaffolding_nodenames={"scaffolding:platform","scaffolding:iron_platform"} minetest.register_on_dignode(function(pos, node) local i=1 diff --git a/init.lua b/init.lua index f557578..13a0951 100644 --- a/init.lua +++ b/init.lua @@ -23,10 +23,24 @@ minetest.register_node("scaffolding:scaffolding", { if tool and tool == "scaffolding:scaffolding_wrench" then node.name = "scaffolding:reinforced_scaffolding" minetest.env:set_node(pos, node) - --puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard")) - --puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer")) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) end - end, + end, + --[[on_rightclick = function(pos, node, player, itemstack, pointed_thing) + if itemstack:get_name() == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:reinforced_scaffolding" + minetest.env:set_node(pos, node) + + end + end, + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "air" + minetest.env:set_node(pos, node) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) + end + end,]] node_box = { type = "fixed", fixed = { @@ -43,7 +57,7 @@ minetest.register_node("scaffolding:scaffolding", { default.dig_up(pos, node, digger) end, }) - + minetest.register_node("scaffolding:reinforced_scaffolding", { description = "Wooden Scaffolding", drawtype = "nodebox", @@ -62,10 +76,24 @@ minetest.register_node("scaffolding:reinforced_scaffolding", { if tool and tool == "scaffolding:scaffolding_wrench" then node.name = "scaffolding:scaffolding" minetest.env:set_node(pos, node) - --puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard")) - --puncher:get_inventory():add_item("main", ItemStack("beer_test:tankard_beer")) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) end - end, + end, + --[[ on_rightclick = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:scaffolding" + minetest.env:set_node(pos, node) + end + end, + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "air" + minetest.env:set_node(pos, node) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) + end + end,]] node_box = { type = "fixed", fixed = { @@ -80,7 +108,78 @@ minetest.register_node("scaffolding:reinforced_scaffolding", { }, }) -minetest.register_node("scaffolding:iron_scaffolding", { + minetest.register_node("scaffolding:platform", { + description = "Wooden Platform", + drawtype = "nodebox", + tiles = {"scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding.png^scaffolding_platform.png"}, + paramtype = "light", + paramtype2 = "facedir", + climbable = false, + walkable = true, + is_ground_content = true, + groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_wood_defaults(), + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:reinforced_platform" + minetest.env:set_node(pos, node) + end + end, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + after_dig_node = function(pos, node, metadata, digger) + default.dig_horx(pos, node, digger) + default.dig_horx2(pos, node, digger) + default.dig_horz(pos, node, digger) + default.dig_horz2(pos, node, digger) + end, + }) + + minetest.register_node("scaffolding:reinforced_platform", { + description = "Wooden Platform", + drawtype = "nodebox", + tiles = {"scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_platform.png"}, + drop = "scaffolding:platform", + paramtype = "light", + paramtype2 = "facedir", + climbable = false, + walkable = true, + is_ground_content = true, + groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_wood_defaults(), + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:platform" + minetest.env:set_node(pos, node) + end + end, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + }) + + minetest.register_node("scaffolding:iron_scaffolding", { description = "Iron Scaffolding", drawtype = "nodebox", tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png", @@ -88,7 +187,7 @@ minetest.register_node("scaffolding:iron_scaffolding", { paramtype = "light", paramtype2 = "facedir", climbable = true, - walkable = true, + walkable = false, is_ground_content = true, groups = {snappy=2,cracky=3}, sounds = default.node_sound_wood_defaults(), @@ -109,13 +208,27 @@ minetest.register_node("scaffolding:iron_scaffolding", { if tool and tool == "scaffolding:scaffolding_wrench" then node.name = "scaffolding:reinforced_iron_scaffolding" minetest.env:set_node(pos, node) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) end - end, - after_dig_node = function(pos, node, metadata, digger) - default.dig_horx(pos, node, digger) - default.dig_horx2(pos, node, digger) - default.dig_horz(pos, node, digger) - default.dig_horz2(pos, node, digger) + end, + --[[on_rightclick = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:reinforced_iron_scaffolding" + minetest.env:set_node(pos, node) + end + end, + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "air" + minetest.env:set_node(pos, node) + --puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard")) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) + end + end,]] + after_dig_node = function(pos, node, metadata, digger) + default.dig_up(pos, node, digger) end, }) @@ -128,17 +241,34 @@ minetest.register_node("scaffolding:iron_scaffolding", { paramtype = "light", paramtype2 = "facedir", climbable = true, - walkable = true, + walkable = false, is_ground_content = true, groups = {snappy=2,cracky=3}, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:iron_scaffolding" + minetest.env:set_node(pos, node) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) + end + end, + --[[on_rightclick = function(pos, node, puncher) local tool = puncher:get_wielded_item():get_name() if tool and tool == "scaffolding:scaffolding_wrench" then node.name = "scaffolding:iron_scaffolding" minetest.env:set_node(pos, node) end end, + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "air" + minetest.env:set_node(pos, node) + --puncher:get_inventory():remove_item("main", ItemStack("beer_test:tankard")) + puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding")) + end + end,]] node_box = { type = "fixed", fixed = { @@ -152,6 +282,81 @@ minetest.register_node("scaffolding:iron_scaffolding", { }, }, }) + + minetest.register_node("scaffolding:iron_platform", { + description = "Iron Platform", + drawtype = "nodebox", + tiles = {"scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding_top.png", "scaffolding_iron_scaffolding.png^scaffolding_platform.png"}, + paramtype = "light", + paramtype2 = "facedir", + climbable = false, + walkable = true, + is_ground_content = true, + groups = {snappy=2,cracky=3}, + sounds = default.node_sound_wood_defaults(), + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:reinforced_iron_platform" + minetest.env:set_node(pos, node) + end + end, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + after_dig_node = function(pos, node, metadata, digger) + default.dig_horx(pos, node, digger) + default.dig_horx2(pos, node, digger) + default.dig_horz(pos, node, digger) + default.dig_horz2(pos, node, digger) + end, + }) + + minetest.register_node("scaffolding:reinforced_iron_platform", { + description = "Iron Platform", + drawtype = "nodebox", + tiles = {"scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_platform.png"}, + drop = "scaffolding:iron_platform", + paramtype = "light", + paramtype2 = "facedir", + climbable = false, + walkable = true, + is_ground_content = true, + groups = {snappy=2,cracky=3}, + sounds = default.node_sound_wood_defaults(), + on_punch = function(pos, node, puncher) + local tool = puncher:get_wielded_item():get_name() + if tool and tool == "scaffolding:scaffolding_wrench" then + node.name = "scaffolding:iron_platform" + minetest.env:set_node(pos, node) + end + end, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3, -0.5, 0.5, 0.1, 0.5}, + }, + }, + }) + +---------------------- +-- wood scaffolding -- +---------------------- minetest.register_craft({ output = 'scaffolding:scaffolding 12', @@ -171,23 +376,102 @@ minetest.register_craft({ } }) +-- back to scaffolding -- + +minetest.register_craft({ + output = 'scaffolding:scaffolding', + recipe = { + {'scaffolding:platform'}, + {'scaffolding:platform'}, + } +}) + +-- wood platforms -- + +minetest.register_craft({ + output = 'scaffolding:platform 2', + recipe = { + {'scaffolding:scaffolding'}, + } +}) + +minetest.register_craft({ + output = 'scaffolding:platform 6', + recipe = { + {'scaffolding:scaffolding', 'scaffolding:scaffolding', 'scaffolding:scaffolding'}, + } +}) + +-- get wood back -- + +minetest.register_craft({ + output = 'default:wood', + recipe = { + {'scaffolding:scaffolding', 'scaffolding:scaffolding'}, + } +}) + +---------------------- +-- iron scaffolding -- +---------------------- + minetest.register_craft({ output = 'scaffolding:iron_scaffolding 12', recipe = { - {'default:wood', 'default:wood', 'default:wood'}, - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'default:wood', 'default:wood', 'default:wood'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:stick', '', 'default:stick'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, } }) minetest.register_craft({ output = 'scaffolding:iron_scaffolding 4', recipe = { - {'default:wood'}, {'default:steel_ingot'}, - {'default:wood'}, + {'default:stick'}, + {'default:steel_ingot'}, } }) +-- back to scaffolding -- + +minetest.register_craft({ + output = 'scaffolding:iron_scaffolding', + recipe = { + {'scaffolding:iron_platform'}, + {'scaffolding:iron_platform'}, + } +}) + +-- iron platforms -- + +minetest.register_craft({ + output = 'scaffolding:iron_platform 2', + recipe = { + {'scaffolding:iron_scaffolding'}, + } +}) + +minetest.register_craft({ + output = 'scaffolding:iron_platform 6', + recipe = { + {'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding'}, + } +}) + +-- get iron back -- + +minetest.register_craft({ + output = 'default:steel_ingot', + recipe = { + {'scaffolding:iron_scaffolding', 'scaffolding:iron_scaffolding'}, + } +}) + + + +------------ +-- wrench -- +------------ minetest.register_craft({ output = 'scaffolding:scaffolding_wrench', @@ -197,3 +481,5 @@ minetest.register_craft({ {'default:steel_ingot', '', ''}, } }) + + diff --git a/textures/scaffolding_platform.png b/textures/scaffolding_platform.png new file mode 100644 index 0000000000000000000000000000000000000000..4f7749d5ac371b49a7491c0d851ec3b8097f15ce GIT binary patch literal 2918 zcmV-s3z_tZP)pPPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5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