myholeinthewall/nodes.lua
2015-03-23 20:03:44 -07:00

232 lines
6.7 KiB
Lua

function myholeinthewall.register_all(mat, desc, image, mygroups, craft, drawtype)
minetest.register_node("myholeinthewall:diamond_"..mat,{
-- description = desc.." Diamond",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{0.125, -0.5, -0.5, 0.5, -0.3125, 0.5},
{-0.5, -0.5, -0.5, -0.125, -0.3125, 0.5},
{-0.5, 0.3125, -0.5, -0.125, 0.5, 0.5},
{0.125, 0.3125, -0.5, 0.5, 0.5, 0.5},
{0.1875, -0.5, -0.5, 0.5, -0.25, 0.5},
{0.25, -0.5, -0.5, 0.5, -0.1875, 0.5},
{0.3125, -0.5, -0.5, 0.5, -0.125, 0.5},
{-0.5, -0.5, -0.5, -0.1875, -0.25, 0.5},
{-0.5, -0.5, -0.5, -0.25, -0.1875, 0.5},
{-0.5, -0.5, -0.5, -0.3125, -0.125, 0.5},
{-0.5, 0.25, -0.5, -0.1875, 0.5, 0.5},
{-0.5, 0.1875, -0.5, -0.25, 0.5, 0.5},
{-0.5, 0.125, -0.5, -0.3125, 0.5, 0.5},
{0.1875, 0.25, -0.5, 0.5, 0.5, 0.5},
{0.25, 0.1875, -0.5, 0.5, 0.5, 0.5},
{0.3125, 0.125, -0.5, 0.5, 0.5, 0.5},
{0.0625, -0.5, -0.5, 0.5, -0.375, 0.5},
{-0.5, -0.5, -0.5, -0.0625, -0.375, 0.5},
{-0.5, 0.0625, -0.5, -0.375, 0.5, 0.5},
{-0.5, -0.5, -0.5, -0.375, -0.0625, 0.5},
{-0.5, 0.375, -0.5, -0.0625, 0.5, 0.5},
{0.0625, 0.375, -0.5, 0.5, 0.5, 0.5},
{0.375, -0.5, -0.5, 0.5, -0.0625, 0.5},
{0.375, 0.0625, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})
minetest.register_node("myholeinthewall:diamond_rough_"..mat,{
-- description = desc.." Rough Diamond",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{0.0625, -0.5, -0.5, 0.5, -0.3125, 0.5},
{-0.5, -0.5, -0.5, -0.0625, -0.3125, 0.5},
{-0.5, 0.3125, -0.5, -0.0625, 0.5, 0.5},
{0.0625, 0.3125, -0.5, 0.5, 0.5, 0.5},
{0.1875, -0.5, -0.5, 0.5, -0.1875, 0.5},
{0.3125, -0.5, -0.5, 0.5, -0.0625, 0.5},
{-0.5, -0.5, -0.5, -0.1875, -0.1875, 0.5},
{-0.5, -0.5, -0.5, -0.3125, -0.0625, 0.5},
{-0.5, 0.1875, -0.5, -0.1875, 0.5, 0.5},
{-0.5, 0.0625, -0.5, -0.3125, 0.5, 0.5},
{0.1875, 0.1875, -0.5, 0.5, 0.5, 0.5},
{0.3125, 0.0625, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})
minetest.register_node("myholeinthewall:cross_"..mat,{
-- description = desc.." Cross",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{0.125, -0.5, -0.5, 0.5, -0.125, 0.5},
{-0.5, -0.5, -0.5, -0.125, -0.125, 0.5},
{-0.5, 0.125, -0.5, -0.125, 0.5, 0.5},
{0.125, 0.125, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})
minetest.register_node("myholeinthewall:cross_iron_"..mat,{
-- description = desc.." Iron Cross",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
{-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
{0.4375, -0.5, -0.5, 0.5, 0.5, 0.5},
{0.125, -0.5, -0.5, 0.5, -0.3125, 0.5},
{-0.5, -0.5, -0.5, -0.125, -0.3125, 0.5},
{-0.5, 0.3125, -0.5, -0.125, 0.5, 0.5},
{0.125, 0.3125, -0.5, 0.5, 0.5, 0.5},
{0.1875, -0.5, -0.5, 0.5, -0.25, 0.5},
{0.25, -0.5, -0.5, 0.5, -0.1875, 0.5},
{0.3125, -0.5, -0.5, 0.5, -0.125, 0.5},
{-0.5, -0.5, -0.5, -0.1875, -0.25, 0.5},
{-0.5, -0.5, -0.5, -0.25, -0.1875, 0.5},
{-0.5, -0.5, -0.5, -0.3125, -0.125, 0.5},
{-0.5, 0.25, -0.5, -0.1875, 0.5, 0.5},
{-0.5, 0.1875, -0.5, -0.25, 0.5, 0.5},
{-0.5, 0.125, -0.5, -0.3125, 0.5, 0.5},
{0.1875, 0.25, -0.5, 0.5, 0.5, 0.5},
{0.25, 0.1875, -0.5, 0.5, 0.5, 0.5},
{0.3125, 0.125, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})
minetest.register_node("myholeinthewall:o_"..mat,{
-- description = desc.." O",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.25, 0.3125, -0.5, 0.25, 0.5, 0.5},
{-0.25, -0.5, -0.5, 0.25, -0.3125, 0.5},
{-0.5, -0.25, -0.5, -0.3125, 0.25, 0.5},
{0.3125, -0.25, -0.5, 0.5, 0.25, 0.5},
{0.125, -0.4375, -0.5, 0.3125, -0.25, 0.5},
{0.1875, -0.375, -0.5, 0.375, -0.1875, 0.5},
{0.25, -0.3125, -0.5, 0.4375, -0.125, 0.5},
{-0.3125, -0.4375, -0.5, -0.125, -0.25, 0.5},
{-0.375, -0.375, -0.5, -0.1875, -0.1875, 0.5},
{-0.4375, -0.3125, -0.5, -0.25, -0.125, 0.5},
{-0.3125, 0.25, -0.5, -0.125, 0.4375, 0.5},
{-0.375, 0.1875, -0.5, -0.1875, 0.375, 0.5},
{-0.4375, 0.125, -0.5, -0.25, 0.3125, 0.5},
{0.125, 0.25, -0.5, 0.3125, 0.4375, 0.5},
{0.1875, 0.1875, -0.5, 0.375, 0.375, 0.5},
{0.25, 0.125, -0.5, 0.4375, 0.3125, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})minetest.register_node("myholeinthewall:x_"..mat,{
-- description = desc.." X",
tiles = {image},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {crumbly = 1},
node_box = {
type = "fixed",
fixed = {
{-0.5, 0.25, -0.5, -0.25, 0.5, 0.5},
{-0.375, 0.125, -0.5, -0.125, 0.375, 0.5},
{-0.25, 0.0625, -0.5, -0.0625, 0.25, 0.5},
{-0.5, -0.5, -0.5, -0.25, -0.25, 0.5},
{-0.375, -0.375, -0.5, -0.125, -0.125, 0.5},
{-0.25, -0.25, -0.5, -0.0625, -0.0625, 0.5},
{0.25, 0.25, -0.5, 0.5, 0.5, 0.5},
{0.125, 0.125, -0.5, 0.375, 0.375, 0.5},
{0.0625, 0.0625, -0.5, 0.25, 0.25, 0.5},
{0.25, -0.5, -0.5, 0.5, -0.25, 0.5},
{0.125, -0.375, -0.5, 0.375, -0.125, 0.5},
{0.0625, -0.25, -0.5, 0.25, -0.0625, 0.5},
{-0.1875, -0.1875, -0.5, 0.1875, 0.1875, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
}
},
on_place = minetest.rotate_node,
})
end