
1.20.1: Crash when placing a specific chest (UpgradeHandler ArrayIndexOutOfBoundsException)
andrewsf opened this issue ยท 3 comments
Minecraft: 1.20.1
Sophisticated Storage (sophisticatedstorage), Version: 1.3.9.1075
Sophisticated Core (sophisticatedcore), Version: 1.2.18.890
I have an Iron Oak Chest. Trying to place it causes a crash when WoodStorageBlockBase is trying to set up the inventory size (stack trace below). Seems like StorageWrapper#changeSize
must be getting called with a negative additionalUpgradeSlots
value (shrinking??)
According to NBTExplorer the only NBT set on this item in my inventory is woodType
"oak", and a uuid
.
All other containers seem to work fine. I suspect this chest might have been a quest reward from a quest in ATM 9 To the Sky, since I don't think I crafted it. Just in case this did come from a quest with some hardcoded UUID -- NBTExplorer writes the UUID as 825113162 -1124249737 -1332596101 97658160]
which I think resolves to 312e3a4a-bcfd-4f77-b092-327b05d22530
.
I wanted to see if this UUID matched up with some saved data, but the world save doesn't have a data/sophisticatedstorage.dat
file.
The most relevant part of the exception & stack trace are:
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.util.Arrays$ArrayList.set(Arrays.java:4170) ~[?:?] {}
at net.minecraft.core.NonNullList.set(NonNullList.java:54) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?] {re:mixin,re:classloading}
at net.p3pp3rf1y.sophisticatedcore.upgrades.UpgradeHandler.increaseSize(UpgradeHandler.java:338) ~[sophisticatedcore-1.20.1-1.2.18.890.jar%23717!/:1.20.1-1.2.18.890] {re:classloading}
at net.p3pp3rf1y.sophisticatedstorage.block.StorageWrapper.changeSize(StorageWrapper.java:433) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at net.p3pp3rf1y.sophisticatedstorage.block.WoodStorageBlockBase.setNewSize(WoodStorageBlockBase.java:178) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at net.p3pp3rf1y.sophisticatedstorage.block.WoodStorageBlockBase.lambda$setPlacedBy$3(WoodStorageBlockBase.java:156) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {re:mixin}
at net.p3pp3rf1y.sophisticatedstorage.block.WoodStorageBlockBase.lambda$setPlacedBy$4(WoodStorageBlockBase.java:150) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at java.util.Optional.ifPresent(Optional.java:178) ~[?:?] {re:mixin}
at net.p3pp3rf1y.sophisticatedstorage.block.WoodStorageBlockBase.m_6402_(WoodStorageBlockBase.java:149) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at net.p3pp3rf1y.sophisticatedstorage.block.ChestBlock.m_6402_(ChestBlock.java:304) ~[sophisticatedstorage-1.20.1-1.3.9.1075.jar%23718!/:1.20.1-1.3.9.1075] {re:classloading}
at net.minecraft.world.item.BlockItem.m_40576_(BlockItem.java:79) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:moonlight-common.mixins.json:BlockItemMixin,pl:mixin:APP:create.mixins.json:BlockItemMixin,pl:mixin:A}
at net.minecraft.world.item.BlockItem.m_6225_(BlockItem.java:46) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:moonlight-common.mixins.json:BlockItemMixin,pl:mixin:APP:create.mixins.json:BlockItemMixin,pl:mixin:A}
at net.minecraft.world.item.ItemStack.lambda$useOn$3(ItemStack.java:246) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack,pl:mixin:APP:apotheosis.mixins.json:ItemStackMixin,pl:mixin:APP:useitemonblockevent.mixins.json:ItemStackMixin,pl:mixin:APP:attributeslib.mixins.json:ItemStackMixin,pl:mixin:APP:tombstone.mixins.json:ItemStackMixin,pl:mixin:APP:necronomicon-common.mixins.json:item.AnimatedItemNameMixin,pl:mixin:APP:alltheleaks.mixins.json:main.ATLItemStackMixin,pl:mixin:APP:canary.mixins.json:util.item_stack_tracking.ItemStackMixin,pl:mixin:APP:showcaseitem.mixins.json:ItemStackMixin,pl:mixin:APP:placebo.mixins.json:ItemStackMixin,pl:mixin:APP:kubejs-common.mixins.json:ItemStackMixin,pl:mixin:APP:itemfilters-common.mixins.json:ItemStackMixin,pl:mixin:APP:fastsuite.mixins.json:ItemStackMixin,pl:mixin:APP:forbidden_arcanus.mixins.json:ItemStackMixin,pl:mixin:A}
at net.minecraft.world.item.ItemStack.onItemUse(ItemStack.java:261) ~[client-1.20.1-20230612.114412-srg.jar%23758!/:?] {re:mixin,xf:fml:forge:itemstack,re:classloading,xf:fml:forge:itemstack,pl:mixin:APP:apotheosis.mixins.json:ItemStackMixin,pl:mixin:APP:useitemonblockevent.mixins.json:ItemStackMixin,pl:mixin:APP:attributeslib.mixins.json:ItemStackMixin,pl:mixin:APP:tombstone.mixins.json:ItemStackMixin,pl:mixin:APP:necronomicon-common.mixins.json:item.AnimatedItemNameMixin,pl:mixin:APP:alltheleaks.mixins.json:main.ATLItemStackMixin,pl:mixin:APP:canary.mixins.json:util.item_stack_tracking.ItemStackMixin,pl:mixin:APP:showcaseitem.mixins.json:ItemStackMixin,pl:mixin:APP:placebo.mixins.json:ItemStackMixin,pl:mixin:APP:kubejs-common.mixins.json:ItemStackMixin,pl:mixin:APP:itemfilters-common.mixins.json:ItemStack
The full crash report is provided.
As we discussed in Discord there not being nbt for an item that has uuid is an issue of the modpack maker that included the item with uuid in the pack. But this should also be handled more gracefully in code so I have added a check and logging that makes it so that uuid and items name gets logged in case no storage nbt is found while storage is being placed. this is now included in the latest release of Sophisticated Storage