123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490 |
- scaffolding = scaffolding or {}
- scaffolding.modpath = minetest.get_modpath("scaffolding")
- dofile(minetest.get_modpath("scaffolding").."/sort.lua")
- if not scaffolding.run_once then
- dofile(minetest.get_modpath("scaffolding").."/functions.lua")
- minetest.register_craftitem("scaffolding:scaffolding_wrench", {
- description = "Scaffolding Reinforcement & Chest Sorting Wrench",
- inventory_image = "scaffolding_wrench.png",
- on_use = function(...)
- return scaffolding.wrench_on_use(...)
- end,
- })
- minetest.register_node("scaffolding:scaffolding", {
- description = "Wooden Scaffolding",
- drawtype = "nodebox",
- tiles = {"scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding_top.png", "scaffolding_wooden_scaffolding.png",
- "scaffolding_wooden_scaffolding.png", "scaffolding_wooden_scaffolding.png", "scaffolding_wooden_scaffolding.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- climbable = true,
- walkable = false,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- 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_scaffolding"
- minetest.add_node(pos, node)
- --puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
- 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.add_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.add_node(pos, node)
- puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
- end
- end,]]
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- _no_collapse_on_walkover = true,
- after_dig_node = function(pos, node, metadata, digger)
- default.dig_up(pos, node, digger)
- end,
- })
- minetest.register_node("scaffolding:reinforced_scaffolding", {
- description = "Wooden Scaffolding",
- drawtype = "nodebox",
- tiles = {"scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png", "scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png",
- "scaffolding_wooden_scaffolding.png^scaffolding_reinforced.png"},
- drop = "scaffolding:scaffolding",
- paramtype = "light",
- paramtype2 = "facedir",
- climbable = true,
- walkable = false,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_wood_defaults(),
- _no_collapse_on_walkover = true,
- 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:scaffolding"
- minetest.add_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:scaffolding"
- minetest.add_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.add_node(pos, node)
- puncher:get_inventory():add_item("main", ItemStack("scaffolding:scaffolding"))
- end
- end,]]
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- })
- 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,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_wood_defaults(),
- _no_collapse_on_walkover = true,
- 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.add_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)
- scaffolding.dig_horx(pos, node, digger)
- scaffolding.dig_horx2(pos, node, digger)
- scaffolding.dig_horz(pos, node, digger)
- scaffolding.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,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_wood_defaults(),
- _no_collapse_on_walkover = true,
- 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.add_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",
- "scaffolding_iron_scaffolding.png", "scaffolding_iron_scaffolding.png", "scaffolding_iron_scaffolding.png"},
- paramtype = "light",
- paramtype2 = "facedir",
- climbable = true,
- walkable = false,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_stone_defaults(),
- _no_collapse_on_walkover = true,
- node_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- 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_scaffolding"
- minetest.add_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:reinforced_iron_scaffolding"
- minetest.add_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.add_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,
- })
- minetest.register_node("scaffolding:reinforced_iron_scaffolding", {
- description = "Iron Scaffolding",
- drawtype = "nodebox",
- tiles = {"scaffolding_iron_scaffolding.png^scaffolding_reinforced.png", "scaffolding_iron_scaffolding.png^scaffolding_reinforced.png",
- "scaffolding_iron_scaffolding.png^scaffolding_reinforced.png"},
- drop = "scaffolding:iron_scaffolding",
- paramtype = "light",
- paramtype2 = "facedir",
- climbable = true,
- walkable = false,
- _no_collapse_on_walkover = true,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_stone_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.add_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.add_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.add_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 = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- selection_box = {
- type = "fixed",
- fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
- },
- },
- })
- 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,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_stone_defaults(),
- _no_collapse_on_walkover = true,
- 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.add_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)
- scaffolding.dig_horx(pos, node, digger)
- scaffolding.dig_horx2(pos, node, digger)
- scaffolding.dig_horz(pos, node, digger)
- scaffolding.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,
- groups = utility.dig_groups("scaffolding", {scaffolding=1}),
- sounds = default.node_sound_stone_defaults(),
- _no_collapse_on_walkover = true,
- 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.add_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',
- recipe = {
- {'group:wood', 'group:wood', 'group:wood'},
- {'group:stick', '', 'group:stick'},
- {'group:wood', 'group:wood', 'group:wood'},
- }
- })
- minetest.register_craft({
- output = 'scaffolding:scaffolding 4',
- recipe = {
- {'group:wood'},
- {'group:stick'},
- {'group:wood'},
- }
- })
- -- 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'},
- }
- })
- ----------------------
- -- iron scaffolding --
- ----------------------
- minetest.register_craft({
- output = 'scaffolding:iron_scaffolding 12',
- recipe = {
- {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
- {'group:stick', '', 'group:stick'},
- {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
- }
- })
- minetest.register_craft({
- output = 'scaffolding:iron_scaffolding 4',
- recipe = {
- {'default:steel_ingot'},
- {'group: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'},
- }
- })
- ------------
- -- wrench --
- ------------
- minetest.register_craft({
- output = 'scaffolding:scaffolding_wrench',
- recipe = {
- {'', 'default:steel_ingot', ''},
- {'', 'default:steel_ingot', 'default:steel_ingot'},
- {'default:steel_ingot', '', ''},
- }
- })
- local c = "scaffolding:core"
- local f = scaffolding.modpath .. "/init.lua"
- reload.register_file(c, f, false)
- scaffolding.run_once = true
- end
|