Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
Current=0
End=90
Type Index
0Dirt
1Wood
--and so on
register_secret_passage = function(typename, nodetype)
minetest.register_craft({
output = 'NodeItem "'secret_passage:'..typename..'"',
recipe = {
{ 'node "secret_passage:compoent"', nodetype, 'node "secret_passage:compoent"'},
{ 'node "secret_passage:compoent"', nodetype, 'node "secret_passage:compoent"'}
}
})
minetest.register_node(typename, {
drawtype = 'allfaces',
tile_images = {'sp_'..nodetype..'.png'},
inventory_image = {'sp'..nodetype..'.png'},
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
climable = false,
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
material = minetest.digprop_constanttime(1.0),
dug_item = 'NodeItem "'secret_passage:'..typename 1',
})
end
local Call_Register = function()
while Current <= End do
register_secret_passage(TypeIndex[Current], TypeIndex[Current]
Current = Current + 1
end
end
Call_register()
Alright. There's what I threw together, now my question is would this work? If it would work, then a lot of people's mods could become less lengthy in code lines.
And yes I'd change this to a bit like MarkTraceur's add_tool.