forked from mtcontrib/scaffolding
Update to 0.5
This commit is contained in:
parent
05c1577d4c
commit
2a362d1479
121
init.lua
121
init.lua
|
@ -1,6 +1,11 @@
|
|||
print("scaffolding: Loading 'functions.lua'")
|
||||
dofile(minetest.get_modpath("scaffolding").."/functions.lua")
|
||||
|
||||
minetest.register_craftitem("scaffolding:scaffolding_wrench", {
|
||||
description = "Scaffolding Wrench",
|
||||
inventory_image = "scaffolding_wrench.png",
|
||||
})
|
||||
|
||||
minetest.register_node("scaffolding:scaffolding", {
|
||||
description = "Wooden Scaffolding",
|
||||
drawtype = "nodebox",
|
||||
|
@ -13,6 +18,15 @@ minetest.register_node("scaffolding:scaffolding", {
|
|||
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_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"))
|
||||
end
|
||||
end,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
|
@ -29,6 +43,42 @@ minetest.register_node("scaffolding:scaffolding", {
|
|||
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,
|
||||
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: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"))
|
||||
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_scaffolding", {
|
||||
description = "Iron Scaffolding",
|
||||
|
@ -54,6 +104,13 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||
{-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.env:set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
after_dig_node = function(pos, node, metadata, digger)
|
||||
default.dig_horx(pos, node, digger)
|
||||
default.dig_horx2(pos, node, digger)
|
||||
|
@ -61,9 +118,43 @@ minetest.register_node("scaffolding:iron_scaffolding", {
|
|||
default.dig_horz2(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 = 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_scaffolding"
|
||||
minetest.env:set_node(pos, node)
|
||||
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_craft({
|
||||
output = 'scaffolding:scaffolding 6',
|
||||
output = 'scaffolding:scaffolding 12',
|
||||
recipe = {
|
||||
{'default:wood', 'default:wood', 'default:wood'},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
|
@ -72,7 +163,16 @@ minetest.register_craft({
|
|||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'scaffolding:iron_scaffolding 6',
|
||||
output = 'scaffolding:scaffolding 4',
|
||||
recipe = {
|
||||
{'default:wood'},
|
||||
{'default:stick'},
|
||||
{'default:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'scaffolding:iron_scaffolding 12',
|
||||
recipe = {
|
||||
{'default:wood', 'default:wood', 'default:wood'},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
|
@ -80,3 +180,20 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'scaffolding:iron_scaffolding 4',
|
||||
recipe = {
|
||||
{'default:wood'},
|
||||
{'default:steel_ingot'},
|
||||
{'default:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'scaffolding:scaffolding_wrench',
|
||||
recipe = {
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', '', ''},
|
||||
}
|
||||
})
|
||||
|
|
BIN
textures/scaffolding_reinforced.png
Normal file
BIN
textures/scaffolding_reinforced.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
textures/scaffolding_wrench.png
Normal file
BIN
textures/scaffolding_wrench.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.0 KiB |
Loading…
Reference in New Issue
Block a user