0.6.4
The miner will consume energy and never barrel, emitting pollution and consuming energy and resource endlessly.
I suggest a small patching, but it uses early returns and idk if that's a no-no for style reasons.
Around line 398:
if item_count >= recipe.ingredients[1].amount then
local max_cycles = math.floor(math.min(fluid.amount / recipe.ingredients[2].amount, item_count / recipe.ingredients[1].amount))
if max_cycles > 0 then
fluid.amount = fluid.amount - max_cycles * recipe.ingredients[2].amount
inv.remove({name = recipe.ingredients[1].name, count=recipe.ingredients[1].amount * max_cycles})
insert_products(miner, recipe.products, max_cycles)
end
end
end
end
end
end
end
could be changed to
if item_count >= recipe.ingredients[1].amount then
local max_cycles = math.floor(math.min(fluid.amount / recipe.ingredients[2].amount, item_count / recipe.ingredients[1].amount))
if max_cycles > 0 then
fluid.amount = fluid.amount - max_cycles * recipe.ingredients[2].amount
inv.remove({name = recipe.ingredients[1].name, count=recipe.ingredients[1].amount * max_cycles})
insert_products(miner, recipe.products, max_cycles)
end
else
miner.stopped_on_fluid = fluid.name
return
end
end
end
end
miner.stopped_on_fluid = nil
end
end
And then on line 440-ish:
]]--
if miner.stopped_on_fluid then
barrel_fluids(miner)
if miner.stopped_on_fluid then
return
end
end
-- (Mining power - Mining hardness) * Mining speed / Mining time = Production rate (in resource/sec)
The effect of this is the miner stops barreling once it completes at least one cycle... it partially fills barrels, but on the next iteration, will mine an entire time before failing the item count check, keeping < 2x mining's worth.
Pedantically, if productivity increased, it could be over 2x (e.g. fills 1/5 barrels, needing 4, next cycle has more productivity and can fill 6 worth, so >= 2x is possible but then barreling stops and only restarts when enough barrels are in the miner). The mining would keep succeeding if there was as little as one barrel.
A final code change around 398 would be:
if item_count >= recipe.ingredients[1].amount then
local max_cycles = math.floor(math.min(fluid.amount / recipe.ingredients[2].amount, item_count / recipe.ingredients[1].amount))
if max_cycles > 0 then
fluid.amount = fluid.amount - max_cycles * recipe.ingredients[2].amount
inv.remove({name = recipe.ingredients[1].name, count=recipe.ingredients[1].amount * max_cycles})
insert_products(miner, recipe.products, max_cycles)
if fluid.amount > recipe.ingredients[2].amount then
miner.stopped_on_fluid = fluid.name
return
end
end
else
miner.stopped_on_fluid = fluid.name
return
end
end
end
end
miner.stopped_on_fluid = nil
end
...onto another report because mining productivity for fluids is broken
0.6.4 The miner will consume energy and never barrel, emitting pollution and consuming energy and resource endlessly.
I suggest a small patching, but it uses early returns and idk if that's a no-no for style reasons.
Around line 398:
could be changed to
And then on line 440-ish:
The effect of this is the miner stops barreling once it completes at least one cycle... it partially fills barrels, but on the next iteration, will mine an entire time before failing the item count check, keeping < 2x mining's worth.
Pedantically, if productivity increased, it could be over 2x (e.g. fills 1/5 barrels, needing 4, next cycle has more productivity and can fill 6 worth, so >= 2x is possible but then barreling stops and only restarts when enough barrels are in the miner). The mining would keep succeeding if there was as little as one barrel.
A final code change around 398 would be:
...onto another report because mining productivity for fluids is broken