mirror of
https://github.com/sirrobzeroone/elepower.git
synced 2024-08-19 20:34:04 +02:00
Heat exchanger fix
This commit is contained in:
parent
9c481b6055
commit
b12daa099a
@ -22,6 +22,7 @@ ele.helpers.register_liquid("lithium", {
|
|||||||
liquid_viscosity = 4,
|
liquid_viscosity = 4,
|
||||||
damage_per_second = 1,
|
damage_per_second = 1,
|
||||||
alpha = 200,
|
alpha = 200,
|
||||||
|
gas_form = "elepower_dynamics:lithium_gas",
|
||||||
post_effect_color = {a = 103, r = 229, g = 227, b = 196},
|
post_effect_color = {a = 103, r = 229, g = 227, b = 196},
|
||||||
groups = {lithium = 1, liquid = 3},
|
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", {
|
minetest.register_node("elepower_dynamics:steam", {
|
||||||
description = "Steam",
|
description = "Steam",
|
||||||
groups = {not_in_creative_inventory = 1, gas = 1},
|
groups = {not_in_creative_inventory = 1, gas = 1},
|
||||||
|
liquid_form = "default:water_source",
|
||||||
tiles = {"elepower_steam.png"},
|
tiles = {"elepower_steam.png"},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -63,6 +65,7 @@ minetest.register_node("elepower_dynamics:nitrogen", {
|
|||||||
minetest.register_node("elepower_dynamics:lithium_gas", {
|
minetest.register_node("elepower_dynamics:lithium_gas", {
|
||||||
description = "Lithium Gas",
|
description = "Lithium Gas",
|
||||||
groups = {not_in_creative_inventory = 1, gas = 1, lithium = 1},
|
groups = {not_in_creative_inventory = 1, gas = 1, lithium = 1},
|
||||||
|
liquid_form = "elepower_dynamics:lithium_source",
|
||||||
tiles = {"elepower_lithium.png"},
|
tiles = {"elepower_lithium.png"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -36,14 +36,20 @@ local function heat_exchanger_timer(pos)
|
|||||||
local steam = fluid_lib.get_buffer_data(pos, "steam")
|
local steam = fluid_lib.get_buffer_data(pos, "steam")
|
||||||
|
|
||||||
while true do
|
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
|
break
|
||||||
end
|
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
|
-- 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 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
|
if cold.fluid ~= damnt.out and cold.fluid ~= "" then
|
||||||
break
|
break
|
||||||
@ -53,10 +59,10 @@ local function heat_exchanger_timer(pos)
|
|||||||
water_convert = steam.capacity - steam.amount
|
water_convert = steam.capacity - steam.amount
|
||||||
end
|
end
|
||||||
|
|
||||||
if water_convert > 0 and cold.amount + 1000 < cold.capacity then
|
if water_convert > 0 and cold.amount + heatper <= cold.capacity then
|
||||||
-- Conversion
|
-- Conversion
|
||||||
heat.amount = heat.amount - 1000
|
heat.amount = heat.amount - heatper
|
||||||
cold.amount = cold.amount + 1000
|
cold.amount = cold.amount + heatper
|
||||||
|
|
||||||
water.amount = water.amount - water_convert
|
water.amount = water.amount - water_convert
|
||||||
steam.amount = steam.amount + water_convert
|
steam.amount = steam.amount + water_convert
|
||||||
|
Loading…
Reference in New Issue
Block a user