Andrew6rant / Stacker

Minecraft mod to change the stack size of all items. Fabric 1.19, 1.18, and 1.17.
Creative Commons Zero v1.0 Universal
26 stars 17 forks source link

Crash when stacking red cell batteries #23

Closed dathide closed 2 years ago

dathide commented 2 years ago

A crash occurs 2 red cell batteries from the mod "Tech Reborn" are stacked. My log reads:

[14:11:01] [Render thread/FATAL]: Reported exception thrown!
net.minecraft.class_148: Rendering screen
    at net.minecraft.class_757.method_3192(class_757.java:883) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1523(class_310.java:1112) ~[client-intermediary.jar:?]
    at net.minecraft.class_310.method_1514(class_310.java:728) [client-intermediary.jar:?]
    at net.minecraft.client.main.Main.main(Main.java:217) [client-intermediary.jar:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:602) [fabric-loader-0.12.11.jar:?]
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77) [fabric-loader-0.12.11.jar:?]
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.12.11.jar:?]
Caused by: java.lang.IllegalArgumentException: Invalid count: 2
    at team.reborn.energy.api.base.SimpleBatteryItem.getStoredEnergy(SimpleBatteryItem.java:55) ~[team_reborn_energy-2.0.0-beta1-a90c99d8af2f3ca2.jar:?]
    at reborncore.common.util.ItemUtils.getPowerForDurabilityBar(ItemUtils.java:116) ~[RebornCore-5.0.11-beta.jar:?]
    at techreborn.items.BatteryItem.getDurability(BatteryItem.java:117) ~[TechReborn-5.0.11-beta.jar:?]
    at net.minecraft.class_918.handler$faj000$renderGuiItemOverlay(class_918.java:7062) ~[client-intermediary.jar:?]
    at net.minecraft.class_918.method_4022(class_918.java) ~[client-intermediary.jar:?]
    at net.minecraft.class_465.method_2385(class_465.java:266) ~[client-intermediary.jar:?]
    at net.minecraft.class_465.method_25394(class_465.java:123) ~[client-intermediary.jar:?]
    at net.minecraft.class_485.method_25394(class_485.java:43) ~[client-intermediary.jar:?]
    at net.minecraft.class_490.method_25394(class_490.java:92) ~[client-intermediary.jar:?]
    at net.minecraft.class_757.method_3192(class_757.java:874) ~[client-intermediary.jar:?]
    ... 10 more

Is there a way that I can manually disable this item's ability to stack?

Andrew6rant commented 2 years ago

Unfortunately, not at the moment. I am planning a config system in the far future, but for the time being I can look into hardcoding a way to stop certain items from stacking (non-empty Imnis backpacks are another, for example)

dathide commented 2 years ago

Okay, thank you for the response. I look forward to the hard-coded fix, and the config system sounds very nice.

Andrew6rant commented 2 years ago

This is fixed in Stacker 3.0.0, the new config system is set up to automatically set red cell batteries (and 25 other TechReborn items) stack sizes to 1.