mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
improve sponge
This commit is contained in:
parent
2f35c70877
commit
acc9ac7e5d
1 changed files with 3 additions and 6 deletions
|
@ -1,6 +1,4 @@
|
||||||
|
|
||||||
if minetest.setting_get("liquid_finite") then
|
|
||||||
|
|
||||||
minetest.register_node("sponge:sponge", {
|
minetest.register_node("sponge:sponge", {
|
||||||
description = "Sponge",
|
description = "Sponge",
|
||||||
drawtype = "normal",
|
drawtype = "normal",
|
||||||
|
@ -47,6 +45,8 @@ if minetest.setting_get("liquid_finite") and minetest.setting_get("liquid_relax"
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
if minetest.setting_get("liquid_finite") then
|
||||||
|
|
||||||
local replacewith = "air"
|
local replacewith = "air"
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
|
@ -89,10 +89,7 @@ action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
for k=-2,2 do
|
for k=-2,2 do
|
||||||
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
|
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
|
||||||
n = minetest.env:get_node(p)
|
n = minetest.env:get_node(p)
|
||||||
if (n.name == "default:water_flowing")
|
if minetest.registered_nodes[n.name] and minetest.registered_nodes[n.name].liquidtype ~= "none" then
|
||||||
or (n.name == "default:water_source")
|
|
||||||
or (n.name == "default:lava_source")
|
|
||||||
or (n.name == "default:lava_flowing") then
|
|
||||||
minetest.env:add_node(p, {name=replacewith})
|
minetest.env:add_node(p, {name=replacewith})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue