tom5454 / Toms-Storage

Simple vanilla style storage mod for Minecraft
https://www.curseforge.com/minecraft/mc-mods/toms-storage
MIT License
115 stars 38 forks source link

some blocks against inventory trim cause crash #243

Open Trickster29 opened 1 year ago

Trickster29 commented 1 year ago
java.lang.NullPointerException: Null inventory is not supported.
    at java.base/java.util.Objects.requireNonNull(Objects.java:233)
    at net.fabricmc.fabric.api.transfer.v1.item.InventoryStorage.of(InventoryStorage.java:65)
    at nourl.mythicmetalsdecorations.MythicMetalsDecorations.lambda$registerChestStorage$2(MythicMetalsDecorations.java:70)
    at net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup.lambda$registerForBlockEntity$0(BlockApiLookup.java:221)
    at net.fabricmc.fabric.impl.lookup.block.BlockApiLookupImpl.lambda$registerForBlockEntities$1(BlockApiLookupImpl.java:160)
    at net.fabricmc.fabric.impl.lookup.block.BlockApiLookupImpl.find(BlockApiLookupImpl.java:90)
    at com.tom.storagemod.tile.InventoryConnectorBlockEntity.updateServer(InventoryConnectorBlockEntity.java:90)
    at com.tom.storagemod.util.TickerUtil.lambda$createTicker$1(TickerUtil.java:10)
    at net.minecraft.class_2818$class_5563.redirect$zli000$carpet$checkProcessBEs(class_2818.java:789)
    at net.minecraft.class_2818$class_5563.method_31703(class_2818.java:665)
    at net.minecraft.class_2818$class_5564.method_31703(class_2818.java:719)
    at net.minecraft.class_1937.method_18471(class_1937.java:478)
    at net.minecraft.class_3218.method_18765(class_3218.java:376)
    at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:901)
    at net.minecraft.class_3176.method_3813(class_3176.java:283)
    at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:828)
    at net.minecraft.server.MinecraftServer.handler$zlf000$carpet$modifiedRunLoop(MinecraftServer.java:7936)
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:654)
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:266)
    at java.base/java.lang.Thread.run(Thread.java:833)

to reproduce i put jungle logs against the inventory trim while it was active with a network i do remember shift rightclicking to place if that matters.

this causes an unlimited server crash loop unless you remove the block with an external editor or reload a backup world file

Toms Verision 1.5.7 Fabric Minecraft 1.19.4

tom5454 commented 1 year ago

Place a vanilla hopper pointing at the block, to see if it crashes. The error mentions Mythic Metals Decorations, their custom chest handler may be the problem.

Trickster29 commented 1 year ago

All I did was place a vanilla jungle log. I am unsure why it's mentioned mythic metals. Unless I grabbed the crash report where the mythic metals chest was blocked from above rather than the jungle log report. I did not, that is very weird. However if you just put a try catch statement over your line of code that the catch does nothing this crash would probably just stop. I'd build and change it myself but this seems more complicated to build than other mods.

Also a hopper has an inventory so that wouldn't cause the error of course.

I also should say that their are mythic metals chests connected to the inventory trim. But they work fine. The only time it doesn't work is when a non inventory block is attached. (jungle log)

I should probably reiterate that it seems to be non-inventory blocks against the inventory trim that cause this issue.