Fix Water Duplication Due to Flowing Liquids

This commit is contained in:
snoutie 2025-01-08 10:20:29 +01:00
parent 4e8223c20f
commit fa60ac48a2

15
api.lua
View File

@ -80,14 +80,11 @@ function liquid_physics.register_liquid(namespace, source_name, flowing_name)
if flowing_liquid_def.liquidtype ~= "flowing" then
error("Liquid Physics: " ..
source_liquid_name .. " is of type " .. source_liquid_def.drawtype .. " and not of type source")
source_liquid_name .. " is of type " .. source_liquid_def.drawtype .. " and not of type flowing")
end
--Overwrite source
source_liquid_def.liquid_range = 0
source_liquid_def.liquid_renewable = false
source_liquid_def.liquid_alternative_flowing = source_liquid_name
source_liquid_def.liquid_alternative_source = source_liquid_name
core.register_node(":" .. source_liquid_name, source_liquid_def)
liquid_physics._liquid_ids[source_liquid_name] = id
@ -142,14 +139,8 @@ function liquid_physics.register_liquid(namespace, source_name, flowing_name)
table.insert(liquids, source_liquid_name)
--Finally, replace flowing, such that it behaves like a source
flowing_liquid_def.liquidtype = "source"
flowing_liquid_def.liquid_range = 0
flowing_liquid_def.liquid_renewable = false
flowing_liquid_def.liquid_alternative_flowing = source_liquid_name
flowing_liquid_def.liquid_alternative_source = source_liquid_name
core.register_node(":" .. flowing_liquid_name, flowing_liquid_def)
-- Finally, stop flowing
core.override_item(flowing_liquid_name, { liquid_range = 0, liquid_renewable = false }, nil)
liquid_physics._liquid_ids[flowing_liquid_name] = id
liquid_physics._registered_liquids[id] = liquids