Thanks guys! Right after sfan5 responded, I did read the description, and saw that it was a mod.. After searching around, I found it on github, and took this code:
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
minetest.register_abm(
{nodenames = {"default:lava_source"},
interval = 5,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
for i=-1,1 do
for j=-1,1 do
for k=-1,1 do
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
n = minetest.env:get_node(p)
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
minetest.env:add_node(pos, {name="default:cobble"})
end
end
end
end
end
})
minetest.register_abm(
{nodenames = {"default:lava_flowing"},
interval = 5,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
for i=-1,1 do
for j=-1,1 do
for k=-1,1 do
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
n = minetest.env:get_node(p)
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
if (j==-1) then
minetest.env:add_node({x=pos.x, y=pos.y-1, z=pos.z}, {name="default:cobble"})
else
minetest.env:add_node(pos, {name="default:cobble"})
end
end
end
end
end
end
})
print("[Obsidian] Loaded!")
but changed one slight thing. A place where it would change flowing lave to a custom block (that cannot be removed) and I changed that to default:cobble. Then after a little trial and error, I realized that I needed to switch the sides of the lava and water, and it worked :)
So in the end result, I used a blinky plant, a switch, a microcontroller and a piston to push the blocks out after they are generated, but since it can only push 16, after the 16th, the circuit still goes, but the piston does not move at all. This is just the start of a self repairing bridge, or self repairing anything if implemented correctly :)