summaryrefslogtreecommitdiff
path: root/lrfurn
diff options
context:
space:
mode:
Diffstat (limited to 'lrfurn')
-rw-r--r--lrfurn/armchairs.lua13
-rw-r--r--lrfurn/init.lua3
-rw-r--r--lrfurn/longsofas.lua13
-rw-r--r--lrfurn/sofas.lua13
4 files changed, 35 insertions, 7 deletions
diff --git a/lrfurn/armchairs.lua b/lrfurn/armchairs.lua
index 1155050..fcb84e5 100644
--- a/lrfurn/armchairs.lua
+++ b/lrfurn/armchairs.lua
@@ -25,9 +25,7 @@ minetest.register_node("lrfurn:armchair", {
node_box = armchair_cbox,
after_place_node = function(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation_nsew(pos, placer, itemstack, pointed_thing)
- unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
end,
- 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
@@ -58,6 +56,17 @@ minetest.register_craft({
}
})
+unifieddyes.register_color_craft({
+ output = "lrfurn:armchair",
+ palette = "wallmounted",
+ type = "shapeless",
+ neutral_node = "lrfurn:armchair",
+ recipe = {
+ "NEUTRAL_NODE",
+ "MAIN_DYE"
+ }
+})
+
-- convert old static nodes to param2 color
lrfurn.old_static_armchairs = {}
diff --git a/lrfurn/init.lua b/lrfurn/init.lua
index 0ac264c..97cc586 100644
--- a/lrfurn/init.lua
+++ b/lrfurn/init.lua
@@ -60,10 +60,11 @@ end
function lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
+ local colorbits = node.param2 - (node.param2 % 8)
local yaw = placer:get_look_yaw()
local dir = minetest.yaw_to_dir(yaw-1.5)
local fdir = minetest.dir_to_wallmounted(dir)
- minetest.swap_node(pos, { name = node.name, param2 = fdir })
+ minetest.swap_node(pos, { name = node.name, param2 = fdir+colorbits })
end
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
diff --git a/lrfurn/longsofas.lua b/lrfurn/longsofas.lua
index 05db65d..eeb3ca2 100644
--- a/lrfurn/longsofas.lua
+++ b/lrfurn/longsofas.lua
@@ -26,7 +26,6 @@ minetest.register_node("lrfurn:longsofa", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
- unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
local playername = placer:get_player_name()
if minetest.is_protected(pos, placer:get_player_name()) then return true end
@@ -42,7 +41,6 @@ minetest.register_node("lrfurn:longsofa", {
end
return itemstack
end,
- after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
return itemstack
@@ -72,6 +70,17 @@ minetest.register_craft({
}
})
+unifieddyes.register_color_craft({
+ output = "lrfurn:longsofa",
+ palette = "wallmounted",
+ type = "shapeless",
+ neutral_node = "lrfurn:longsofa",
+ recipe = {
+ "NEUTRAL_NODE",
+ "MAIN_DYE"
+ }
+})
+
-- convert old static nodes to param2 colorization
lrfurn.old_static_longsofas = {}
diff --git a/lrfurn/sofas.lua b/lrfurn/sofas.lua
index de1b784..6f89bea 100644
--- a/lrfurn/sofas.lua
+++ b/lrfurn/sofas.lua
@@ -26,7 +26,6 @@ minetest.register_node("lrfurn:sofa", {
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
- unifieddyes.recolor_on_place(pos, placer, itemstack, pointed_thing)
local playername = placer:get_player_name()
if minetest.is_protected(pos, placer:get_player_name()) then return true end
@@ -42,7 +41,6 @@ minetest.register_node("lrfurn:sofa", {
end
return itemstack
end,
- after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then
return itemstack
@@ -72,6 +70,17 @@ minetest.register_craft({
}
})
+unifieddyes.register_color_craft({
+ output = "lrfurn:sofa",
+ palette = "wallmounted",
+ type = "shapeless",
+ neutral_node = "lrfurn:sofa",
+ recipe = {
+ "NEUTRAL_NODE",
+ "MAIN_DYE"
+ }
+})
+
-- convert old static nodes to param2 color
lrfurn.old_static_sofas = {}