nodeu/portau.lua

84 lines
2.4 KiB
Lua

local Portau_list = {
{ "Red Portau", "red"},
{ "Orange Portau", "orange"},
{ "Cyan Portau", "cyan"},
{ "Yellow Portau", "yellow"},
{ "Green Portau", "green"},
{ "Blue Portau", "blue"},
{ "Violet Portau", "violet"},
{ "Black Portau", "black"},
{ "White Portau", "white"},
{ "Grey Portau", "grey"},
}
for i in ipairs(Portau_list) do
local portaudesc = Portau_list[i][1]
local colour = Portau_list[i][2]
minetest.register_node("nodeu:portau_"..colour.."", {
description = portaudesc.."",
drawtype = "mesh",
mesh = "portau2.obj",
tiles = {"portau_"..colour..".png",
},
--inventory_image = "nodeu_p_"..colour..".png",
--wield_image = {"nodeu_p_"..colour..".png",
-- },
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
light_source = 20,
walkable = false,
selection_box = {
type = "fixed",
--fixed = { -0.5, 1.48, 0.35, 0.5,2.0, 0.5},
fixed = { -2, 1.45, 0.35, 2,2.0, 0.5 },
},
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3,not_in_creative_inventory=1},
--sounds = default.node_sound_wood_defaults(),
drop = "nodeu:portau_"..colour.."_ch",
on_rightclick = function(pos, node, clicker)
node.name = "nodeu:portau_"..colour.."_ch"
minetest.set_node(pos, node)
end,
})
minetest.register_node("nodeu:portau_"..colour.."_ch", {
description = portaudesc.." ch",
drawtype = "mesh",
mesh = "portau.obj",
tiles = {"portau_"..colour..".png",
},
inventory_image = "nodeu_p_"..colour..".png",
wield_image = {"nodeu_p_"..colour..".png",
},
paramtype = "light",
paramtype2 = "facedir",
light_source = 20,
sunlight_propagates = true,
-- walkable = true,
collision_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.35, 0.5,1.5, 0.5}},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.35, 0.5,1.5, 0.5}
--fixed = { -0.5, 0.35, -0.5, 0.5,1.5, 0.5},
},-- largdx h
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=0},
--sounds = default_dig_cracky(),
drop = "nodeu:portau_"..colour.."_ch",
on_rightclick = function(pos, node, clicker)
node.name = "nodeu:portau_"..colour..""
minetest.set_node(pos, node)
end,
})
end