Add scaffolding
This commit is contained in:
parent
170f7b29f5
commit
f65427c48b
@ -99,6 +99,15 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "gloopblocks:scaffolding 12",
|
||||
recipe = {
|
||||
{"default:stick", "group:wood", "default:stick"},
|
||||
{"", "default:stick", ""},
|
||||
{"default:stick", "group:wood", "default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "gloopblocks:evil_stick 4",
|
||||
recipe = {
|
||||
|
38
init.lua
38
init.lua
@ -137,6 +137,44 @@ minetest.register_node("gloopblocks:cobble_road_mossy", {
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("gloopblocks:scaffolding", {
|
||||
description = "Wooden Scaffold",
|
||||
drawtype = "allfaces",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
tiles = {"gloopblocks_scaffold.png"},
|
||||
groups = {choppy=3, oddly_breakable_by_hand=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rightclick = function(pos, node, clicker, itemstack)
|
||||
if itemstack:get_name() == node.name then
|
||||
for i = 1,19 do
|
||||
if minetest.get_node({x=pos.x,y=pos.y-i,z=pos.z}).name == "gloopblocks:scaffolding" and scafffound ~= 0 and scafffound ~= 1 then
|
||||
local scafffound = 1
|
||||
return itemstack
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
for i = 1,19 do
|
||||
if minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == "air" and scaffworked ~= 1 and scaffworked ~= 0 then
|
||||
minetest.set_node({x=pos.x,y=pos.y+i,z=pos.z}, {name="gloopblocks:scaffolding"})
|
||||
local scaffworked = 1
|
||||
return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1)))
|
||||
elseif minetest.get_node({x=pos.x,y=pos.y+i,z=pos.z}).name == "gloopblocks:scaffolding" then
|
||||
else
|
||||
local scaffworked = 0
|
||||
end
|
||||
end
|
||||
if scaffworked == 1 then
|
||||
return ItemStack(tostring(itemstack:get_name().." "..tostring(itemstack:get_count()-1)))
|
||||
else
|
||||
return itemstack
|
||||
end
|
||||
else return itemstack end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
minetest.register_alias("moreblocks:oerkkiblock", "gloopblocks:oerkki_block")
|
||||
minetest.register_alias("gloopblocks:obsidian", "default:obsidian")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user