Code tweaks
This commit is contained in:
parent
787a260220
commit
2befb9a980
@ -44,7 +44,7 @@ minetest.register_abm({
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = 10,
|
chance = 10,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
minetest.add_node(pos, {name="default:mossycobble"})
|
minetest.add_node(pos, {name="default:mossycobble"})
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -55,9 +55,10 @@ minetest.register_abm({
|
|||||||
interval = 15,
|
interval = 15,
|
||||||
chance = 2,
|
chance = 2,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local pos0 = {x=pos.x-1,y=pos.y-1,z=pos.z-1}
|
local water = minetest.find_nodes_in_area(
|
||||||
local pos1 = {x=pos.x+1,y=pos.y+1,z=pos.z+1}
|
{x=pos.x-1,y=pos.y-1,z=pos.z-1},
|
||||||
local water = minetest.find_nodes_in_area(pos0, pos1, "default:water_source")
|
{x=pos.x+1,y=pos.y+1,z=pos.z+1},
|
||||||
|
"default:water_source")
|
||||||
if water then
|
if water then
|
||||||
minetest.set_node(water[1], {name="default:ice"})
|
minetest.set_node(water[1], {name="default:ice"})
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user