Barrel Size


Customize the fluid capacity of barrels.

Content
3 years ago
0.17 - 1.1
4.34K
Logistics

i Optional dependency for Bobplates

4 years ago

Hello,
i have implemented an optional dependency for bobplates. If you want you can implement the changes.

In info.json:
- added dependency: "? bobplates >= 0.17.0"

And becourse Bob changes the barrels and gas bottles after the data.lua of this mod is run i've moved all the changes into data-final-fixes.lua. Here the code i've got there:

local SIZE_STACK = settings.startup["barrel-size-stack"].value
local TIME_EMP = settings.startup["barrel-size-empty-time"].value
local TIME_FIL = settings.startup["barrel-size-fill-time"].value
local CAP = settings.startup["barrel-size-capacity"].value

--CHANGE TIME AND AMOUNT
for _,_recipe in pairs(data.raw.recipe) do
if _recipe.subgroup=="fill-barrel" or
_recipe.subgroup=="bob-gas-bottle" then
_recipe.energy_required = TIME_FIL
_recipe.ingredients[1].amount = CAP
elseif _recipe.subgroup=="empty-barrel" or
_recipe.subgroup=="bob-empty-gas-bottle" then
_recipe.energy_required = TIME_EMP
_recipe.results[1].amount = CAP
end
end

--CHANGE STACK SIZE
data.raw.item["empty-barrel"].stack_size = SIZE_STACK
for _, _item in pairs(data.raw.item) do
if _item.subgroup=="bob-gas-bottle" or
_item.subgroup=="bob-barrel"or
_item.subgroup=="fill-barrel"
then
_item.stack_size = SIZE_STACK
end
end

I don't know, if there is a way to do these changes in data.lua without getting them overridden.

4 years ago

When I write my mods I try to write them to be flexible, but don't like tailoring them to specific content of other mods (such as new categories like "bob-empty-gas-bottle"), partly because that's a compatibility nightmare and because I assume that any mod defining new things like that ought to know what it's doing regarding internal balance/consistency and handle them itself (these are actually kind of the same point). Enjoy your edit if you play with Bob's by all means, but I probably won't be changing this.

4 years ago
(updated 4 years ago)

All right.
Thanks for the mod anyway

New response