Added chainlink fence gate. Place a fence back into the crafting grid to get a

gate.  Place it, then click it to open/close.
This commit is contained in:
Vanessa Ezekowitz 2012-09-30 21:16:41 -04:00
parent c6b2bde0a1
commit 87e5ed95a0
7 changed files with 105 additions and 4 deletions

View File

@ -1157,3 +1157,19 @@ minetest.register_craft( {
{ "default:steel_ingot", "default:iron_lump", "default:steel_ingot" }
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_chainlink_gate_closed",
recipe = {
"homedecor:fence_chainlink"
},
})
minetest.register_craft( {
type = "shapeless",
output = "homedecor:fence_chainlink",
recipe = {
"homedecor:fence_chainlink_gate_closed"
},
})

View File

@ -172,10 +172,95 @@ minetest.register_node("homedecor:fence_chainlink", {
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
{ 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself
{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
{ 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself
}
},
})
minetest.register_node("homedecor:fence_chainlink_gate_closed", {
drawtype = "nodebox",
description = "Chainlink Fence Gate",
tiles = {
"homedecor_fence_chainlink_gate_tb.png",
"homedecor_fence_chainlink_gate_tb.png",
"homedecor_fence_chainlink_gate_sides.png",
"homedecor_fence_chainlink_gate_sides.png",
"homedecor_fence_chainlink_gate_backside.png",
"homedecor_fence_chainlink_gate_front.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -8/16, 7/16, 13/32, 8/16, 8/16, 15/32 }, -- top piece
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 }, -- the chainlink itself
{ -8/16, -3/16, 6/16, -6/16, 3/16, 8/16 } -- the lump representing the lock
}
},
})
minetest.register_node("homedecor:fence_chainlink_gate_open", {
drawtype = "nodebox",
description = "Chainlink Fence Gate (open)",
tiles = {
"homedecor_fence_chainlink_gate_tb.png",
"homedecor_fence_chainlink_gate_tb.png",
"homedecor_fence_chainlink_gate_front.png",
"homedecor_fence_chainlink_gate_backside.png",
"homedecor_fence_chainlink_gate_sides.png",
"homedecor_fence_chainlink_gate_sides.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { 0.375, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ 6/16, -8/16, -8/16, 8/16, 8/16, -7/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ 13/32, 7/16, -8/16, 15/32, 8/16, 8/16 }, -- top piece
{ 13/32, -8/16, -8/16, 15/32, -7/16, 8/16 }, -- bottom piece
{ 7/16, -8/16, -8/16, 7/16, 8/16, 8/16 }, -- the chainlink itself
{ 6/16, -3/16, -8/16, 8/16, 3/16, -6/16 } -- the lump representing the lock
}
},
drop = "homedecor:fence_chainlink_gate_closed"
})
minetest.register_on_punchnode(function (pos, node)
if node.name=="homedecor:fence_chainlink_gate_closed" then
fdir=node.param2
minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_open", param2 = fdir })
end
end)
minetest.register_on_punchnode(function (pos, node)
if node.name=="homedecor:fence_chainlink_gate_open" then
fdir=node.param2
minetest.env:add_node(pos, { name = "homedecor:fence_chainlink_gate_closed", param2 = fdir })
end
end)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B