Integrated Dynamics

Integrated Dynamics

63M Downloads

Power capacity dupe with Energy Battery, when crafting stacks together

Jack-McKalling opened this issue ยท 3 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

When you craft multiple energy batteries together to merge their capacities, but you stacked the input items, the output sums up the stack totals, instead of the capacities of the actual batteries that get used up for each craft.

Steps to reproduce the problem:

  1. Craft/get 18 Energy Batteries of 1M RF
  2. Drag them to fill a crafting grid with all 18 of them in a 3x3 recipe, so each stack has a size of 2
  3. Hover over one of the input item stacks, the tooltip mentions 2M RF capacity (see screenshot A)
  4. Hover over the output (see screenshot B)
    โ†’ โŒ The tooltip mentions 18M RF capacity on the battery instead of 9M RF

The capacity doesn't get properly updated either when the inputs change (might be different bug). Wanted to mention as it might further explain this bug:

  1. Take one input battery out of the grid so one of the stacks now has a size of only 1 item
  2. Hover over the output again (see screenshot C)
    โ†’ โŒ The tooltip now mentions only 17M RF, understandably but should still be only 9M RF
  3. Put the 18th item back in the input grid where you placed it before so you're at the same state of step 2
  4. Hover over the output again (see screenshot D)
    โ†’ โŒ The tooltip still mentions 17M RF!

Merging Energy Batteries

Expected behaviour:

Each craft of multiple batteries should only sum up the capacities of the actual batteries that will get used up for the craft, not the capacities of each stack's total worth.

I did expect that a stack of 2x 1M RF capacity would show a total of 2M RF, this is convenient. However this is not the number that I expected to be used when crafting from only one item of said stack.


Suggested fix:

The total capacity of a stack of Energy Batteries and the capacity of a single Energy Battery in a stack should be mention separately. And a craft should be using only the number for the result that represents the single item.

For instance, a tooltip such as this:

  • Energy Battery
  • 0 / 1 000 000 RF
  • 0 / 2 000 000 RF (whole stack)

Versions:

  • This mod: 1.10.5
  • Tunnels: 1.8.8
  • Core: 1.12.1
  • CC: 2.8.0
  • Minecraft: 1.16.5
  • Forge: 36.2.19

Log file:

commented

Thanks for reporting!

commented

Relates to #1100, but is not the same. This issue has no other mod related.

commented

In fact, I believe your fix for that issue is what probably caused this one. Because in version 1.10.2 (the version prior) this issue doesn't happen.

Glancing over the code changes, the behaviour looks like it is using getMaxEnergyStored() for each craft, which now returns the stack total, where as the changes should be referring to getMaxEnergyStoredSingular() instead now.