170 lines
5.2 KiB
Lua
170 lines
5.2 KiB
Lua
minetest.register_node('furniture:traffic_barrel', {
|
|
description = 'Traffic Barrel',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_traffic_barrel.obj',
|
|
tiles = {'furniture_traffic_barrel.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
|
|
},
|
|
groups = {breakable=1},
|
|
})
|
|
|
|
minetest.register_node('furniture:traffic_barricade', {
|
|
description = 'Traffic Barricade',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_traffic_barricade.obj',
|
|
tiles = {'furniture_traffic_barricade.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.5, -.5, -.125, 1.5, .5, .125},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.5, -.5, -.125, 1.5, 1, .125},
|
|
},
|
|
groups = {breakable=1},
|
|
})
|
|
|
|
minetest.register_node('furniture:fire_hydrant', {
|
|
description = 'Fire Hydrant',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_fire_hydrant.obj',
|
|
tiles = {'furniture_fire_hydrant.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -.5, -.3125, .3125, .5, .3125},
|
|
},
|
|
groups = {breakable=1},
|
|
after_place_node = function(pos)
|
|
local under_node = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
|
|
if minetest.get_item_group(under_node, 'slab') > 0 then
|
|
local node = minetest.get_node(pos)
|
|
minetest.set_node(pos, {name = 'furniture:fire_hydrant_1', param2 = node.param2})
|
|
end
|
|
end,
|
|
})
|
|
|
|
minetest.register_node('furniture:fire_hydrant_1', {
|
|
description = 'Fire Hydrant',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_fire_hydrant_1.obj',
|
|
tiles = {'furniture_fire_hydrant.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
drop = 'furniture:fire_hydrant',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -1, -.3125, .3125, 0, .3125},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.3125, -1, -.3125, .3125, 0, .3125},
|
|
},
|
|
groups = {breakable=1, not_in_creative_inventory=1},
|
|
})
|
|
|
|
minetest.register_node('furniture:parking_bumper', {
|
|
description = 'Parking Bumper',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_parking_bumper.obj',
|
|
tiles = {'furniture_parking_bumper.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.375, -.5, .125, 1.375, -.3125, .375},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.375, -.5, .125, 1.375, -.3125, .375},
|
|
},
|
|
groups = {breakable=1},
|
|
})
|
|
|
|
minetest.register_node('furniture:bollard_popup_0', { --Closed
|
|
description = 'Popup Bollard',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_popup_bollard_down.obj',
|
|
tiles = {'furniture_popup_bollard_down.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
drop = 'furniture:bollard_popup_1',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {-.5, -.5, -.1875, .5, -.375, .1875},
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.5, -.5, -.1875, .5, -.375, .1875},
|
|
},
|
|
groups = {breakable=1, not_in_creative_inventory=1},
|
|
on_rightclick = function(pos, node, clicker)
|
|
local player_name = clicker:get_player_name()
|
|
if not minetest.is_protected(pos, player_name) and minetest.check_player_privs(player_name, { creative = true }) then
|
|
local node = minetest.get_node(pos)
|
|
minetest.set_node(pos, {name = 'furniture:bollard_popup_1', param2 = node.param2})
|
|
end
|
|
end
|
|
})
|
|
|
|
minetest.register_node('furniture:bollard_popup_1', { --Open
|
|
description = 'Popup Bollard',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_popup_bollard_up.obj',
|
|
tiles = {'furniture_popup_bollard_up.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {{-.5, -.5, -.1875, .5, -.375, .1875},
|
|
{-.125, -.375, -.125, .125, .5, .125}}
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {-.5, -.5, -.1875, .5, 1, .1875},
|
|
},
|
|
groups = {breakable=1},
|
|
on_rightclick = function(pos, node, clicker)
|
|
local player_name = clicker:get_player_name()
|
|
if not minetest.is_protected(pos, player_name) and minetest.check_player_privs(player_name, { creative = true }) then
|
|
local node = minetest.get_node(pos)
|
|
minetest.set_node(pos, {name = 'furniture:bollard_popup_0', param2 = node.param2})
|
|
end
|
|
end
|
|
})
|
|
|
|
minetest.register_node('furniture:well', {
|
|
description = 'Well',
|
|
drawtype = 'mesh',
|
|
mesh = 'furniture_well.obj',
|
|
tiles = {'furniture_well.png'},
|
|
paramtype = 'light',
|
|
paramtype2 = 'facedir',
|
|
selection_box = {
|
|
type = 'fixed',
|
|
fixed = {{-.6875, -.5, -.6875, .6875, .125, .6875},
|
|
{-.6875, .75, -.9375, .6875, 1.375, .9375}}
|
|
},
|
|
collision_box = {
|
|
type = 'fixed',
|
|
fixed = {{-.6875, -.5, -.6875, .6875, .125, .6875},
|
|
{-.6875, .75, -.9375, .6875, 1.375, .9375}}
|
|
},
|
|
groups = {breakable=1},
|
|
})
|