Extended Crafting: Nomifactory Edition

Extended Crafting: Nomifactory Edition

2M Downloads

Combination crafting does not work with very high energy values

DerCommander323 opened this issue ยท 3 comments

commented

This is a bug I've encountered on the normal mod version aswell, but if an item made with combination crafting requires a very large amount of energy in total to craft (i assume the limit is 2.147 billion), the item will never finish crafting, it will just forever keep using energy. Using Integrated Dynamics to read the nbt of the crafting core quickly, it is possible to see that the 'Progress' value constantly switches between negative and positive numbers, which I assume is because of the integer limit.

commented

Can you post an example of a script that adds such a recipe, and describe the setup: for example, how are you supplying power? I'm wondering if this is just an overflow as you transfer too much power at once.

commented

Yeah, no, looks like it's just that recipes support cost up to long limit

but the tile is only storing its own power as int

private final EnergyStorageCustom energy = new EnergyStorageCustom(ModConfig.confCraftingCoreRFCapacity);

In Cucumber

In Forge

commented

wouldnt it just be that this variable has to be changed to a long?

since further down at

long difference = recipe.getCost() - this.progress;

from what im understanding its just subtracting the progress value which increases every tick by the energy that the recipe consumed from the total recipe energy cost, until it reaches 0, but since progress isnt a long it will overflow at over 2b and thus if the total energy cost is over that limit it can never subtract enough to bring it to 0 and finish, and if it was a long it could do that, right?