1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-11-17 15:48:31 +01:00
homedecor_modpack/lrfurn/init.lua

34 lines
969 B
Lua
Raw Normal View History

2015-04-07 04:49:46 +02:00
lrfurn = {}
2015-05-15 10:45:21 +02:00
screwdriver = screwdriver or {}
2015-04-07 04:49:46 +02:00
lrfurn.fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
function lrfurn.check_forward(pos, fdir, long)
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 node2 = minetest.get_node(pos2)
if node2 and node2.name ~= "air" then return false end
if long then
local node3 = minetest.get_node(pos3)
if node3 and node3.name ~= "air" then return false end
end
return true
end
2014-07-19 01:37:08 +02:00
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")
dofile(minetest.get_modpath("lrfurn").."/endtable.lua")