summaryrefslogtreecommitdiff
path: root/lrfurn/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-22 17:40:52 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2017-02-22 17:40:52 -0500
commit7ec609f647139aa44bd0ef8c7d908476379cc24f (patch)
tree34aa6fcf193e51260d7cbba2457ea604f1748925 /lrfurn/init.lua
parent0aefae28c513b8ab2357d9f92dbf7f79bd7517e6 (diff)
downloaddreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.gz
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.bz2
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.tar.xz
dreambuilder_modpack-7ec609f647139aa44bd0ef8c7d908476379cc24f.zip
updated homedecor (duh :D )
Diffstat (limited to 'lrfurn/init.lua')
-rw-r--r--lrfurn/init.lua18
1 files changed, 13 insertions, 5 deletions
diff --git a/lrfurn/init.lua b/lrfurn/init.lua
index b529b63..e8b234a 100644
--- a/lrfurn/init.lua
+++ b/lrfurn/init.lua
@@ -2,11 +2,11 @@
lrfurn = {}
screwdriver = screwdriver or {}
-lrfurn.fdir_to_fwd = {
- { 0, 1 },
+lrfurn.fdir_to_right = {
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
+ { 0, 1 },
}
lrfurn.colors = {
@@ -27,11 +27,11 @@ lrfurn.colors = {
"yellow",
}
-function lrfurn.check_forward(pos, fdir, long, placer)
+function lrfurn.check_right(pos, fdir, long, placer)
if not fdir or fdir > 3 then fdir = 0 end
- local pos2 = { x = pos.x + lrfurn.fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + lrfurn.fdir_to_fwd[fdir+1][2] }
- local pos3 = { x = pos.x + lrfurn.fdir_to_fwd[fdir+1][1] * 2, y=pos.y, z = pos.z + lrfurn.fdir_to_fwd[fdir+1][2] * 2 }
+ local pos2 = { x = pos.x + lrfurn.fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] }
+ local pos3 = { x = pos.x + lrfurn.fdir_to_right[fdir+1][1] * 2, y=pos.y, z = pos.z + lrfurn.fdir_to_right[fdir+1][2] * 2 }
local node2 = minetest.get_node(pos2)
if node2 and node2.name ~= "air" then
@@ -58,6 +58,14 @@ function lrfurn.check_forward(pos, fdir, long, placer)
return true
end
+function lrfurn.fix_sofa_rotation_nsew(pos, placer, itemstack, pointed_thing)
+ local node = minetest.get_node(pos)
+ 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 })
+end
+
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")