diff --git a/elepower_dynamics/fluids.lua b/elepower_dynamics/fluids.lua index 0e5d89e..5dd85fc 100644 --- a/elepower_dynamics/fluids.lua +++ b/elepower_dynamics/fluids.lua @@ -22,6 +22,7 @@ ele.helpers.register_liquid("lithium", { liquid_viscosity = 4, damage_per_second = 1, alpha = 200, + gas_form = "elepower_dynamics:lithium_gas", post_effect_color = {a = 103, r = 229, g = 227, b = 196}, groups = {lithium = 1, liquid = 3}, }) @@ -39,6 +40,7 @@ bucket.register_liquid("elepower_dynamics:lithium_source", "elepower_dynamics:li minetest.register_node("elepower_dynamics:steam", { description = "Steam", groups = {not_in_creative_inventory = 1, gas = 1}, + liquid_form = "default:water_source", tiles = {"elepower_steam.png"}, }) @@ -63,6 +65,7 @@ minetest.register_node("elepower_dynamics:nitrogen", { minetest.register_node("elepower_dynamics:lithium_gas", { description = "Lithium Gas", groups = {not_in_creative_inventory = 1, gas = 1, lithium = 1}, + liquid_form = "elepower_dynamics:lithium_source", tiles = {"elepower_lithium.png"}, }) diff --git a/elepower_nuclear/machines/heat_exchanger.lua b/elepower_nuclear/machines/heat_exchanger.lua index 56cccb8..fbd8d53 100644 --- a/elepower_nuclear/machines/heat_exchanger.lua +++ b/elepower_nuclear/machines/heat_exchanger.lua @@ -36,14 +36,20 @@ local function heat_exchanger_timer(pos) local steam = fluid_lib.get_buffer_data(pos, "steam") while true do - if heat.amount < 1000 or heat.fluid == "" or not heat_recipes[heat.fluid] then + if heat.fluid == "" or not heat_recipes[heat.fluid] then break end + -- Convert a maximum of 1000 buckets of hot fluid per second + local heatper = 1000 + if heat.amount < 1000 then + heatper = heat.amount + end + -- See if we have enough hot coolant - if heat.amount >= 1000 and heat.fluid ~= "" then + if heatper > 0 and heat.fluid ~= "" then local damnt = heat_recipes[heat.fluid] - local water_convert = math.min(water.amount, 1000 * damnt.factor) + local water_convert = math.min(water.amount, heatper * damnt.factor) if cold.fluid ~= damnt.out and cold.fluid ~= "" then break @@ -53,10 +59,10 @@ local function heat_exchanger_timer(pos) water_convert = steam.capacity - steam.amount end - if water_convert > 0 and cold.amount + 1000 < cold.capacity then + if water_convert > 0 and cold.amount + heatper <= cold.capacity then -- Conversion - heat.amount = heat.amount - 1000 - cold.amount = cold.amount + 1000 + heat.amount = heat.amount - heatper + cold.amount = cold.amount + heatper water.amount = water.amount - water_convert steam.amount = steam.amount + water_convert