allow player to open/close curtains without a curtainrod

also remove "closed" curtain from creative inv
change recipe to give the "open" one
This commit is contained in:
Vanessa Dannenberg 2019-06-07 05:40:06 -04:00
parent 13862c1a48
commit ed9fb6a34d

View File

@ -106,7 +106,7 @@ minetest.register_node(":homedecor:curtain_closed", {
drawtype = 'signlike',
use_texture_alpha = true,
walkable = false,
groups = { snappy = 3, ud_param2_colorable = 1 },
groups = { snappy = 3, ud_param2_colorable = 1, not_in_creative_inventory=1 },
sounds = default.node_sound_leaves_defaults(),
paramtype = "light",
paramtype2 = "colorwallmounted",
@ -116,12 +116,7 @@ minetest.register_node(":homedecor:curtain_closed", {
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Open the curtains
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = fdir })
end
minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = node.param2 })
return itemstack
end
})
@ -143,12 +138,7 @@ minetest.register_node(":homedecor:curtain_open", {
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local topnode = minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z})
if string.find(topnode.name, "homedecor:curtainrod") then
-- Close the curtains
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = fdir })
end
minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = node.param2 })
return itemstack
end
})
@ -390,7 +380,7 @@ minetest.register_craft({
minetest.register_craft( {
output = "homedecor:curtain_closed 4",
output = "homedecor:curtain_open 4",
recipe = {
{ "wool:white", "", ""},
{ "wool:white", "", ""},
@ -399,7 +389,7 @@ minetest.register_craft( {
})
minetest.register_craft( {
output = "homedecor:curtain_closed 4",
output = "homedecor:curtain_open 4",
recipe = {
{ "cottages:wool", "", ""},
{ "cottages:wool", "", ""},