Epic/mods/furniture/misc.lua

54 lines
1.8 KiB
Lua

minetest.register_node('furniture:railing_straight', {
description = 'Straight Railing',
drawtype = 'mesh',
mesh = 'furniture_railing_straight.obj',
tiles = {'furniture_railing.png'},
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = {
type = 'fixed',
fixed = {-.5, -.5, .4375, .5, .4375, .5625},
},
collision_box = {
type = 'fixed',
fixed = {-.5, -.5, .4375, .5, 1, .5625},
},
groups = {oddly_breakable_by_hand = 2, choppy=3},
after_place_node = function(pos, placer)
if placer:get_player_control().sneak then
local node = minetest.get_node(pos)
local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
minetest.remove_node(pos)
minetest.add_node(new_pos, {name = 'furniture:railing_straight', param2 = node.param2})
end
end,
})
minetest.register_node('furniture:railing_corner', {
description = 'Corner Railing',
drawtype = 'mesh',
mesh = 'furniture_railing_corner.obj',
tiles = {'furniture_railing.png'},
paramtype = 'light',
paramtype2 = 'facedir',
selection_box = {
type = 'fixed',
fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
{.5625, -.5, -.5, .4375, .4375, .5625}}
},
collision_box = {
type = 'fixed',
fixed = {{-.5, -.5, .4375, .5, .4375, .5625},
{.5625, -.5, -.5, .4375, .4375, .5625}}
},
groups = {oddly_breakable_by_hand = 2, choppy=3},
after_place_node = function(pos, placer)
if placer:get_player_control().sneak then
local node = minetest.get_node(pos)
local new_pos = {x = pos.x, y = pos.y+1, z = pos.z}
minetest.remove_node(pos)
minetest.add_node(new_pos, {name = 'furniture:railing_corner', param2 = node.param2})
end
end,
})