All the Mods 9 - ATM9

All the Mods 9 - ATM9

9M Downloads

Evoker prediction crashing game

PmanAce opened this issue ยท 0 comments

commented

Evoker prediction seems to crash the latest version of the game. This crash happens when you have a loot fabricator and an evoker prediction is inserted. The loot fabricator remembers past predictions so it happens on loot fabricators that have run the evoker prediction before. (Possibly previous versions had 1 extra loot available and the loot fabricator remembers the 3rd choice which is not available anymore).

java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[?:?] {}
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[?:?] {}
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[?:?] {}
at java.util.Objects.checkIndex(Objects.java:359) ~[?:?] {re:mixin}
at java.util.ArrayList.get(ArrayList.java:427) ~[?:?] {re:mixin}
at dev.shadowsoffire.hostilenetworks.gui.LootFabScreen.m_7286_(LootFabScreen.java:162) ~[HostileNeuralNetworks-1.20.1-5.2.1.jar%23754!/:5.2.1] {re:classloading}

Hostile Neural Networks (hostilenetworks), Version: 5.2.1
at TRANSFORMER/[email protected]/dev.shadowsoffire.hostilenetworks.gui.LootFabScreen.m_7286_(LootFabScreen.java:162)

Evoker predictions now only have 2 loot items (index 0 and 1) so you should check the loot size array and return the last item instead of the item out of bounds from the array. :)

New loot fabricators don't crash obviously, just the old ones that had predictions remembered.