diff --git a/coal_power_station/firebox.lua b/coal_power_station/firebox.lua index b61888c..6ac5fab 100644 --- a/coal_power_station/firebox.lua +++ b/coal_power_station/firebox.lua @@ -281,11 +281,12 @@ minetest.register_node("techage:oilfirebox", { capa = oilburner.CAPACITY, peek = liquid.srv_peek, put = function(pos, indir, name, amount) - liquid.srv_put(pos, indir, name, amount) + local leftover = liquid.srv_put(pos, indir, name, amount) local mem = tubelib2.get_mem(pos) mem.liquid = mem.liquid or {} mem.liquid.amount = mem.liquid.amount or 0 start_firebox2(pos, mem) + return leftover end, take = liquid.srv_take, }, diff --git a/furnace/firebox.lua b/furnace/firebox.lua index 2d60544..1ed1871 100644 --- a/furnace/firebox.lua +++ b/furnace/firebox.lua @@ -175,13 +175,7 @@ minetest.register_node("techage:furnace_firebox_on", { liquid = { capa = oilburner.CAPACITY, peek = liquid.srv_peek, - put = function(pos, indir, name, amount) - liquid.srv_put(pos, indir, name, amount) - local mem = tubelib2.get_mem(pos) - mem.liquid = mem.liquid or {} - mem.liquid.amount = mem.liquid.amount or 0 - start_firebox(pos, mem) - end, + put = liquid.srv_put, take = liquid.srv_take, }, networks = oilburner.networks, diff --git a/init.lua b/init.lua index 9597825..eee810f 100644 --- a/init.lua +++ b/init.lua @@ -216,6 +216,7 @@ else -- Chemistry --dofile(MP.."/chemistry/ta4_reactor.lua") --dofile(MP.."/chemistry/ta4_doser.lua") + --dofile(MP.."/chemistry/ta4_distiller.lua") -- Hydrogen dofile(MP.."/hydrogen/hydrogen.lua") diff --git a/liquids/liquid.lua b/liquids/liquid.lua index 1852953..15acae6 100644 --- a/liquids/liquid.lua +++ b/liquids/liquid.lua @@ -117,13 +117,13 @@ function techage.liquid.put(pos, outdir, name, amount) if liquid and liquid.put and liquid.peek then -- wrong items? local peek = liquid.peek(item.pos, item.indir) - if peek and peek ~= name then return amount end + if peek and peek ~= name then return amount or 0 end --techage.mark_position("singleplayer", item.pos, "put", "", 1) ------------------- debug amount = liquid.put(item.pos, item.indir, name, amount) - if amount == 0 then break end + if not amount or amount == 0 then break end end end - return amount + return amount or 0 end -- Take given amount of liquid for the remote inventory. @@ -159,6 +159,7 @@ end function techage.liquid.srv_put(pos, indir, name, amount) local mem = tubelib2.get_mem(pos) mem.liquid = mem.liquid or {} + amount = amount or 0 if not mem.liquid.name then mem.liquid.name = name mem.liquid.amount = amount @@ -181,6 +182,7 @@ end function techage.liquid.srv_take(pos, indir, name, amount) local mem = tubelib2.get_mem(pos) mem.liquid = mem.liquid or {} + amount = amount or 0 if not name or mem.liquid.name == name then name = mem.liquid.name mem.liquid.amount = mem.liquid.amount or 0 diff --git a/liquids/tank.lua b/liquids/tank.lua index a1eff95..dd8df09 100644 --- a/liquids/tank.lua +++ b/liquids/tank.lua @@ -105,7 +105,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) if minetest.is_protected(pos, player:get_player_name()) then return 0 end - return 1 + return stack:get_count() end local function allow_metadata_inventory_take(pos, listname, index, stack, player) diff --git a/textures/techage_reactor_side.png b/textures/techage_reactor_side.png index 5845854..9cb1c08 100644 Binary files a/textures/techage_reactor_side.png and b/textures/techage_reactor_side.png differ