Hi, I'm here just to tell about some ideas over this concept. I'm using 4.13 version and playing solo, so many mods are too mutch or just incompatible to me. So, to help me explore caves withour putting hundreds of torchs for each inch I step, I found out this mod but wasn't just fine for me so I did mine based on this concept.
I'm not publishing mine version because it's too simple and I don't know if it can cause some trouble on servers. I home my idea help another mod to became the one we all hope.
So, my mod is a block made of 9 torches, it's like a block of torches. It glows with the 14 lightmax limit, so I've included an airblock that glows too, but it's still air. The trick is that an ABM searches every time for a random node around 6 blocks from the block of torches, so if this random node is air, it changes it for my glowing air. So the block spawn as many blocks as the room space, but slowly to not compromise the processes.
The second trick is a second ABM to the air blocks, they have a life = 12 and every 10 seconds they lose 1. When gets to 0 the blocks comes back to be just air, not glowing. So, this block live 120 seconds. If you dig back the block of torches, all the air blocks remains until the life goes 0.
Hope my idea helps! Thank you.
Here is the code:
Code: Select all
minetest.register_node("supertorch:torch", {
description = "Super Torch",
inventory_image = "icon.png",
paramtype = "light",
tiles = { {
name = "torch_up.png",
animation = {
type = "vertical_frames",
aspect_w=16,
aspect_h=16,
lenght = 2.0
}}},
is_ground_content = false,
groups = {crumbly = 3},
light_source = 14,
})
minetest.register_abm({
label = "supertorch light propagation",
nodenames = {"supertorch:torch"},
interval = 1,
chance = 1,
action = function(pos,node)
local v = vector.new(math.random(-6,6),math.random(-6,6),math.random(-6,6))
local p = vector.add(pos,v)
local node = minetest.get_node(p)
if node.name == "air" then
minetest.set_node(p,{name = "supertorch:airlight"})
end
end
})
minetest.register_node("supertorch:airlight", {
description = "Super torch air light",
paramtype = "light",
drawtype = "airlike",
light_source = 14,
sunlight_propagates = true,
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("life", 12)
end
})
minetest.register_abm({
label = "supertorch light remove",
nodenames = {"supertorch:airlight"},
interval = 10,
chance = 1,
action = function(pos,node)
local meta = minetest.get_meta(pos)
local life = meta:get_int("life")
if life <= 0 then
minetest.set_node(pos,{name = "air"})
else
meta:set_int("life", life - 1)
end
end
})
minetest.register_craft({
output = "supertorch:torch",
recipe = {{"default:torch","default:torch","default:torch"},
{"default:torch","default:torch","default:torch"},
{"default:torch","default:torch","default:torch"}}
})