1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2025-06-28 12:56:01 +02:00

use unified dyes' rotation correction functions

This commit is contained in:
Vanessa Ezekowitz
2017-02-17 23:07:25 -05:00
parent e9477dd45d
commit 6c0dd2d31a
11 changed files with 18 additions and 56 deletions

View File

@ -23,7 +23,7 @@ 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 = lrfurn.fix_rotation,
after_place_node = unifieddyes.fix_rotation,
after_dig_node = unifieddyes.after_dig_node,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not clicker:is_player() then

View File

@ -58,15 +58,6 @@ function lrfurn.check_forward(pos, fdir, long, placer)
return true
end
function lrfurn.fix_rotation(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
local yaw = placer:get_look_yaw()
local dir = minetest.yaw_to_dir(yaw)
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")

View File

@ -24,7 +24,7 @@ minetest.register_node("lrfurn:longsofa", {
node_box = longsofa_cbox,
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
if minetest.is_protected(pos, placer:get_player_name()) then return true end
local fdir = minetest.dir_to_facedir(placer:get_look_dir(), false)

View File

@ -24,7 +24,7 @@ minetest.register_node("lrfurn:sofa", {
node_box = sofa_cbox,
on_rotate = screwdriver.disallow,
after_place_node = function(pos, placer, itemstack, pointed_thing)
lrfurn.fix_rotation(pos, placer, itemstack, pointed_thing)
unifieddyes.fix_rotation(pos, placer, itemstack, pointed_thing)
if minetest.is_protected(pos, placer:get_player_name()) then return true end
local fdir = minetest.dir_to_facedir(placer:get_look_dir(), false)