Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination crafting does not work with very high energy values #21

Open
DerCommander323 opened this issue Dec 16, 2021 · 3 comments · May be fixed by #36
Open

Combination crafting does not work with very high energy values #21

DerCommander323 opened this issue Dec 16, 2021 · 3 comments · May be fixed by #36

Comments

@DerCommander323
Copy link

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.

@eutro
Copy link
Member

eutro commented Dec 16, 2021

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.

@eutro
Copy link
Member

eutro commented Dec 16, 2021

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

@DerCommander323
Copy link
Author

DerCommander323 commented Dec 17, 2021

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?

NotMyWing pushed a commit that referenced this issue Jun 3, 2023
@WaitingIdly WaitingIdly linked a pull request May 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants