diff options
-rw-r--r-- | castle/tapestry.lua | 9 | ||||
-rw-r--r-- | homedecor/books.lua | 2 | ||||
-rw-r--r-- | homedecor/furniture.lua | 3 | ||||
-rw-r--r-- | homedecor/lighting.lua | 3 | ||||
-rw-r--r-- | lrfurn/armchairs.lua | 3 | ||||
-rw-r--r-- | unifieddyes/init.lua | 17 |
6 files changed, 31 insertions, 6 deletions
diff --git a/castle/tapestry.lua b/castle/tapestry.lua index 75b372a..1115b0e 100644 --- a/castle/tapestry.lua +++ b/castle/tapestry.lua @@ -65,7 +65,8 @@ minetest.register_node("castle:tapestry", { wall_side = {-0.5,-0.5,0.4375,0.5,1.5,0.5}, }, after_place_node = unifieddyes.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node + after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew }) -- Crafting from wool and a stick @@ -94,7 +95,8 @@ minetest.register_node("castle:tapestry_long", { wall_side = {-0.5,-0.5,0.4375,0.5,2.5,0.5}, }, after_place_node = unifieddyes.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node + after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew }) -- Crafting from normal tapestry and wool @@ -123,7 +125,8 @@ minetest.register_node("castle:tapestry_very_long", { wall_side = {-0.5,-0.5,0.4375,0.5,3.5,0.5}, }, after_place_node = unifieddyes.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node + after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew }) -- Crafting from long tapestry and wool diff --git a/homedecor/books.lua b/homedecor/books.lua index 891a6ef..9236a25 100644 --- a/homedecor/books.lua +++ b/homedecor/books.lua @@ -86,6 +86,7 @@ homedecor.register("book", { unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) return itemstack end, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_dig = book_dig, selection_box = { type = "fixed", @@ -107,6 +108,7 @@ homedecor.register("book_open", { palette = "unifieddyes_palette_colorwallmounted.png", after_place_node = unifieddyes.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_dig = book_dig, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local meta = minetest.get_meta(pos) diff --git a/homedecor/furniture.lua b/homedecor/furniture.lua index 20c76fb..66098e0 100644 --- a/homedecor/furniture.lua +++ b/homedecor/furniture.lua @@ -59,6 +59,7 @@ homedecor.register("kitchen_chair_wood", { groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), after_place_node = unifieddyes.fix_rotation_nsew, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) pos.y = pos.y+0 -- where do I put my ass ? homedecor.sit(pos, node, clicker) @@ -82,6 +83,7 @@ homedecor.register("kitchen_chair_padded", { sounds = default.node_sound_wood_defaults(), after_place_node = unifieddyes.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) pos.y = pos.y+0 -- where do I put my ass ? homedecor.sit(pos, node, clicker) @@ -105,6 +107,7 @@ homedecor.register("armchair", { node_box = ac_cbox, after_place_node = unifieddyes.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, }) local ob_cbox = { diff --git a/homedecor/lighting.lua b/homedecor/lighting.lua index 8fbc68b..d89a7df 100644 --- a/homedecor/lighting.lua +++ b/homedecor/lighting.lua @@ -494,7 +494,8 @@ homedecor.register("desk_lamp", { walkable = false, groups = {snappy=3, ud_param2_colorable = 1}, after_place_node = unifieddyes.fix_rotation_nsew, - after_dig_node = unifieddyes.after_dig_node + after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew }) -- "kitchen"/"dining room" ceiling lamp diff --git a/lrfurn/armchairs.lua b/lrfurn/armchairs.lua index b36638e..93903f8 100644 --- a/lrfurn/armchairs.lua +++ b/lrfurn/armchairs.lua @@ -23,8 +23,9 @@ minetest.register_node("lrfurn:armchair", { groups = {snappy=3, ud_param2_colorable = 1}, sounds = default.node_sound_wood_defaults(), node_box = armchair_cbox, - after_place_node = unifieddyes.fix_rotation, + after_place_node = unifieddyes.fix_rotation_nsew, after_dig_node = unifieddyes.after_dig_node, + on_rotate = unifieddyes.fix_after_screwdriver_nsew, on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) if not clicker:is_player() then return itemstack diff --git a/unifieddyes/init.lua b/unifieddyes/init.lua index bc8234f..6b5ed13 100644 --- a/unifieddyes/init.lua +++ b/unifieddyes/init.lua @@ -112,7 +112,7 @@ function unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing) end -- use this when you have a "wallmounted" node that should never be oriented --- to floor or ceiling +-- to floor or ceiling... function unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) local node = minetest.get_node(pos) @@ -122,6 +122,21 @@ function unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing) minetest.swap_node(pos, { name = node.name, param2 = fdir }) end +-- ... and use this one to force that kind of node off of floor/ceiling +-- orientation after the screwdriver rotates it. + +function unifieddyes.fix_after_screwdriver_nsew(pos, node, user, mode, new_param2) + local new_fdir = new_param2 % 8 + local color = new_param2 - new_fdir + print(new_fdir) + + if new_fdir < 2 then + new_fdir = 2 + minetest.swap_node(pos, { name = node.name, param2 = new_fdir + color }) + return true + end +end + function unifieddyes.select_node(pointed_thing) local pos = pointed_thing.under local node = minetest.get_node_or_nil(pos) |