canitzp / JustABattery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[1.18.2] Batteries Cannot Be Crafted Above 127-Cells

MaxFirestorm opened this issue · comments

Version: 40.2.0

I added this to the FTB Presents Direwolf20 1.18.2 modpack as I found it was severely lacking in battery capacity stuff and edited the config to allow up to level 100,000 for both capacity and trace width. Trying to craft anything after a 127-Cell Battery results in a Single Battery (along with all the capacity of a Single but maintaining the trace width as that level was still below 128). Even trying something more "sane" like setting up the max config to 130 results in the same.
I realise that maybe trying to go for 100,000 levels is probably not the best idea I ever had, but something smaller above 128 could be? Unsure of what's supposed to happen or if I'm doing something wrong.

2022-06-19 02_12_47-Window
2022-06-19 02_11_55-Window
2022-06-19 02_11_49-Window
2022-06-19 02_12_01-Window

this also happens on the 1.16 version, i suspect it's an overflow issue, though i don't know why or how you would store the level inside only a single byte, i would have expected something larger like Integer.MAX_VALUE (2147483647)
from my testing the trace width does not have the same problem

it is indeed an overflow issue, as using mods which allow reading nbt show the level overflows to -128, hopefully this issue doesn't get shoved to the side

Sorry for the late response.
Indeed the level was originally a byte, but I thought I would have changed it to int later on.
I'll check this issue soon

SO thank you for reporting. I have found the issue and actually don't know, how I have not thought about this.

I'm gonna fix it and then I'll see to which versions I port this fix.