1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

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', drawtype = 'signlike',
use_texture_alpha = true, use_texture_alpha = true,
walkable = false, 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(), sounds = default.node_sound_leaves_defaults(),
paramtype = "light", paramtype = "light",
paramtype2 = "colorwallmounted", paramtype2 = "colorwallmounted",
@ -116,12 +116,7 @@ minetest.register_node(":homedecor:curtain_closed", {
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
end, end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) 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}) minetest.set_node(pos, { name = "homedecor:curtain_open", param2 = node.param2 })
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
return itemstack return itemstack
end end
}) })
@ -143,12 +138,7 @@ minetest.register_node(":homedecor:curtain_open", {
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
end, end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) 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}) minetest.set_node(pos, { name = "homedecor:curtain_closed", param2 = node.param2 })
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
return itemstack return itemstack
end end
}) })
@ -390,7 +380,7 @@ minetest.register_craft({
minetest.register_craft( { minetest.register_craft( {
output = "homedecor:curtain_closed 4", output = "homedecor:curtain_open 4",
recipe = { recipe = {
{ "wool:white", "", ""}, { "wool:white", "", ""},
{ "wool:white", "", ""}, { "wool:white", "", ""},
@ -399,7 +389,7 @@ minetest.register_craft( {
}) })
minetest.register_craft( { minetest.register_craft( {
output = "homedecor:curtain_closed 4", output = "homedecor:curtain_open 4",
recipe = { recipe = {
{ "cottages:wool", "", ""}, { "cottages:wool", "", ""},
{ "cottages:wool", "", ""}, { "cottages:wool", "", ""},