From fa60ac48a29d72338bc013791ffe7027b2b009c6 Mon Sep 17 00:00:00 2001 From: snoutie Date: Wed, 8 Jan 2025 10:20:29 +0100 Subject: [PATCH] Fix Water Duplication Due to Flowing Liquids --- api.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/api.lua b/api.lua index 264433b..647cd0d 100644 --- a/api.lua +++ b/api.lua @@ -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