pumping bugfixes

This commit is contained in:
Joachim Stolberg 2019-11-04 18:56:52 +01:00
parent c33bc5d11c
commit 7dadd2ca99
6 changed files with 10 additions and 12 deletions

View File

@ -281,11 +281,12 @@ minetest.register_node("techage:oilfirebox", {
capa = oilburner.CAPACITY, capa = oilburner.CAPACITY,
peek = liquid.srv_peek, peek = liquid.srv_peek,
put = function(pos, indir, name, amount) 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) local mem = tubelib2.get_mem(pos)
mem.liquid = mem.liquid or {} mem.liquid = mem.liquid or {}
mem.liquid.amount = mem.liquid.amount or 0 mem.liquid.amount = mem.liquid.amount or 0
start_firebox2(pos, mem) start_firebox2(pos, mem)
return leftover
end, end,
take = liquid.srv_take, take = liquid.srv_take,
}, },

View File

@ -175,13 +175,7 @@ minetest.register_node("techage:furnace_firebox_on", {
liquid = { liquid = {
capa = oilburner.CAPACITY, capa = oilburner.CAPACITY,
peek = liquid.srv_peek, peek = liquid.srv_peek,
put = function(pos, indir, name, amount) put = liquid.srv_put,
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,
take = liquid.srv_take, take = liquid.srv_take,
}, },
networks = oilburner.networks, networks = oilburner.networks,

View File

@ -216,6 +216,7 @@ else
-- Chemistry -- Chemistry
--dofile(MP.."/chemistry/ta4_reactor.lua") --dofile(MP.."/chemistry/ta4_reactor.lua")
--dofile(MP.."/chemistry/ta4_doser.lua") --dofile(MP.."/chemistry/ta4_doser.lua")
--dofile(MP.."/chemistry/ta4_distiller.lua")
-- Hydrogen -- Hydrogen
dofile(MP.."/hydrogen/hydrogen.lua") dofile(MP.."/hydrogen/hydrogen.lua")

View File

@ -117,13 +117,13 @@ function techage.liquid.put(pos, outdir, name, amount)
if liquid and liquid.put and liquid.peek then if liquid and liquid.put and liquid.peek then
-- wrong items? -- wrong items?
local peek = liquid.peek(item.pos, item.indir) 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 --techage.mark_position("singleplayer", item.pos, "put", "", 1) ------------------- debug
amount = liquid.put(item.pos, item.indir, name, amount) 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
end end
return amount return amount or 0
end end
-- Take given amount of liquid for the remote inventory. -- Take given amount of liquid for the remote inventory.
@ -159,6 +159,7 @@ end
function techage.liquid.srv_put(pos, indir, name, amount) function techage.liquid.srv_put(pos, indir, name, amount)
local mem = tubelib2.get_mem(pos) local mem = tubelib2.get_mem(pos)
mem.liquid = mem.liquid or {} mem.liquid = mem.liquid or {}
amount = amount or 0
if not mem.liquid.name then if not mem.liquid.name then
mem.liquid.name = name mem.liquid.name = name
mem.liquid.amount = amount mem.liquid.amount = amount
@ -181,6 +182,7 @@ end
function techage.liquid.srv_take(pos, indir, name, amount) function techage.liquid.srv_take(pos, indir, name, amount)
local mem = tubelib2.get_mem(pos) local mem = tubelib2.get_mem(pos)
mem.liquid = mem.liquid or {} mem.liquid = mem.liquid or {}
amount = amount or 0
if not name or mem.liquid.name == name then if not name or mem.liquid.name == name then
name = mem.liquid.name name = mem.liquid.name
mem.liquid.amount = mem.liquid.amount or 0 mem.liquid.amount = mem.liquid.amount or 0

View File

@ -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 if minetest.is_protected(pos, player:get_player_name()) then
return 0 return 0
end end
return 1 return stack:get_count()
end end
local function allow_metadata_inventory_take(pos, listname, index, stack, player) local function allow_metadata_inventory_take(pos, listname, index, stack, player)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 23 KiB