From ed9fb6a34df4764714f05939119b01979382ef9f Mon Sep 17 00:00:00 2001 From: Vanessa Dannenberg Date: Fri, 7 Jun 2019 05:40:06 -0400 Subject: [PATCH] allow player to open/close curtains without a curtainrod also remove "closed" curtain from creative inv change recipe to give the "open" one --- homedecor_windows_and_treatments/init.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/homedecor_windows_and_treatments/init.lua b/homedecor_windows_and_treatments/init.lua index 04bc3765..155221cd 100644 --- a/homedecor_windows_and_treatments/init.lua +++ b/homedecor_windows_and_treatments/init.lua @@ -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", "", ""},