myconcrete/manholes.lua

198 lines
6.6 KiB
Lua

minetest.register_node("myconcrete:manhole", {
description = "Manhole",
tile_images = {
"myconcrete_manhole_top_closed.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png"
},
drawtype = "nodebox",
paramtype = "light",
-- paramtype2 = "facedir",
walkable = true,
climbable = false,
groups = {cracky=2},
node_box = {
type = "fixed",
fixed = {
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, 0.5, -0.1875},
{0.1875, -0.5, -0.5, 0.5, 0.5, -0.375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.1875},
{-0.5, -0.5, -0.5, -0.1875, 0.5, -0.375},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
{-0.5, -0.5, 0.375, -0.1875, 0.5, 0.5},
{-0.5, -0.5, 0.1875, -0.375, 0.5, 0.5},
{-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
{0.375, -0.5, 0.1875, 0.5, 0.5, 0.5},
{0.1875, -0.5, 0.375, 0.5, 0.5, 0.5},
{0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
{0.3125, 0.4375, -0.5, 0.5, 0.5, -0.125},
{0.125, 0.4375, -0.5, 0.5, 0.5, -0.3125},
{0.25, 0.4375, -0.5, 0.5, 0.5, -0.25},
{-0.5, 0.4375, -0.5, -0.3125, 0.5, -0.125},
{-0.5, 0.4375, -0.5, -0.1875, 0.5, -0.3125},
{-0.5, 0.4375, -0.5, -0.25, 0.5, -0.25},
{-0.5, 0.4375, 0.3125, -0.125, 0.5, 0.5},
{-0.5, 0.4375, 0.125, -0.3125, 0.5, 0.5},
{-0.5, 0.4375, 0.25, -0.25, 0.5, 0.5},
{0.3125, 0.4375, 0.125, 0.5, 0.5, 0.5},
{0.125, 0.4375, 0.3125, 0.5, 0.5, 0.5},
{0.25, 0.4375, 0.25, 0.5, 0.5, 0.5},
{0.375, 0.375, -0.5, 0.5, 0.5, 0.5},
{-0.5, 0.4375, 0.375, 0.5, 0.5, 0.5},
{-0.5, 0.4375, -0.5, -0.375, 0.5, 0.5},
{-0.5, 0.4375, -0.5, 0.5, 0.5, -0.375},
{-0.0625, 0.4375, -0.5, 0.0625, 0.5, 0.5},
{0.125, 0.4375, -0.5, 0.1875, 0.5, 0.5},
{0.25, 0.4375, -0.5, 0.3125, 0.5, 0.5},
{-0.1875, 0.4375, -0.5, -0.125, 0.5, 0.5},
{-0.3125, 0.4375, -0.5, -0.25, 0.5, 0.5},
{0.25, 0.1875, -0.5, 0.3125, 0.25, 0.5},
{0.25, -0.3125, -0.5, 0.3125, -0.25, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node(pos,{name = "mystreets:manhole_open", param2 = node.param2})
end,
})
--Manhole open
minetest.register_node("myconcrete:manhole_open", {
description = "Manhole Open",
tile_images = {
"myconcrete_manhole_top_closed.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png"
},
drawtype = "nodebox",
paramtype = "light",
-- paramtype2 = "facedir",
walkable = false,
climbable = true,
drop = "myconcrete:manhole",
groups = {cracky=2, not_in_creative_inventory = 1},
node_box = {
type = "fixed",
fixed = {
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, 0.5, -0.1875},
{0.1875, -0.5, -0.5, 0.5, 0.5, -0.375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.1875},
{-0.5, -0.5, -0.5, -0.1875, 0.5, -0.375},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
{-0.5, -0.5, 0.375, -0.1875, 0.5, 0.5},
{-0.5, -0.5, 0.1875, -0.375, 0.5, 0.5},
{-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
{0.375, -0.5, 0.1875, 0.5, 0.5, 0.5},
{0.1875, -0.5, 0.375, 0.5, 0.5, 0.5},
{0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
{0.4375, 0.5, -0.1875, 0.5, 0.5625, 0.1875},
{0.4375, 0.625, -0.375, 0.5, 0.6875, 0.375},
{0.4375, 0.5625, 0.125, 0.5, 0.625, 0.3125},
{0.4375, 0.5625, -0.3125, 0.5, 0.625, -0.125},
{0.4375, 0.75, -0.4375, 0.5, 0.8125, 0.4375},
{0.4375, 0.6875, -0.375, 0.5, 0.75, -0.3125},
{0.4375, 0.6875, 0.3125, 0.5, 0.75, 0.375},
{0.4375, 0.875, -0.4375, 0.5, 0.9375, 0.4375},
{0.4375, 0.8125, 0.375, 0.5, 0.9375, 0.4375},
{0.4375, 0.8125, -0.4375, 0.5, 0.875, -0.375},
{-0.5, 0.5, -0.1875, -0.4375, 0.5625, 0.1875},
{-0.5, 0.625, -0.375, -0.4375, 0.6875, 0.375},
{-0.5, 0.5625, 0.125, -0.4375, 0.625, 0.3125},
{-0.5, 0.5625, -0.3125, -0.4375, 0.625, -0.125},
{-0.5, 0.75, -0.4375, -0.4375, 0.8125, 0.4375},
{-0.5, 0.6875, -0.375, -0.4375, 0.75, -0.3125},
{-0.5, 0.6875, 0.3125, -0.4375, 0.75, 0.375},
{-0.5, 0.875, -0.4375, -0.4375, 0.9375, 0.4375},
{-0.5, 0.8125, 0.375, -0.4375, 0.9375, 0.4375},
{-0.5, 0.8125, -0.4375, -0.4375, 0.875, -0.375},
{0.25, 0.1875, -0.5, 0.3125, 0.25, 0.5},
{0.25, -0.3125, -0.5, 0.3125, -0.25, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node(pos,{name = "myconcrete:manhole", param2 = node.param2})
end,
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(10)
end,
on_timer = function(pos, elapsed)
minetest.set_node(pos,{name = "myconcrete:manhole"})
end,
})
--Manhole shaft
minetest.register_node("myconcrete:manhole_shaft", {
description = "Manhole Open",
tile_images = {
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png",
"myconcrete_concrete.png"
},
drawtype = "nodebox",
paramtype = "light",
-- paramtype2 = "facedir",
walkable = false,
climbable = true,
groups = {cracky=2, not_in_creative_inventory = 0},
node_box = {
type = "fixed",
fixed = {
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, 0.5, -0.1875},
{0.1875, -0.5, -0.5, 0.5, 0.5, -0.375},
{0.3125, -0.5, -0.5, 0.5, 0.5, -0.3125},
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.1875},
{-0.5, -0.5, -0.5, -0.1875, 0.5, -0.375},
{-0.5, -0.5, -0.5, -0.3125, 0.5, -0.3125},
{-0.5, -0.5, 0.375, -0.1875, 0.5, 0.5},
{-0.5, -0.5, 0.1875, -0.375, 0.5, 0.5},
{-0.5, -0.5, 0.3125, -0.3125, 0.5, 0.5},
{0.375, -0.5, 0.1875, 0.5, 0.5, 0.5},
{0.1875, -0.5, 0.375, 0.5, 0.5, 0.5},
{0.3125, -0.5, 0.3125, 0.5, 0.5, 0.5},
{0.25, 0.1875, -0.5, 0.3125, 0.25, 0.5},
{0.25, -0.3125, -0.5, 0.3125, -0.25, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5},
}
},
})