RFTools

RFTools

74M Downloads

[Request] Storage Scanner, error report & recovery

ShetiPhian opened this issue ยท 3 comments

commented

While playing Project Ozone 3, it was noticed the Storage Scanner wouldn't scan all the inventories.
After some troubleshooting (aka removing stuff added since last known working state) two blocks where found to be causing it.

AE2 Stuff - Crystal Growth Chamber (ae2stuff:grower)
Loot Bags - Bag Opener (lootbags:loot_opener)

Could you make it so the scanner skips over these bad inventories rather then completely aborting the scan? Posting and/or logging the bad inventory would also be helpful when hunting down an issue.

Here is the error they cause:

[Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_51]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_51]
	at net.minecraft.util.Util.func_181617_a(SourceFile:47) [h.class:?]
	at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:723) [MinecraftServer.class:?]
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668) [MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185) [chd.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
Caused by: java.lang.NullPointerException
	at net.minecraftforge.items.wrapper.SidedInvWrapper.hashCode(SidedInvWrapper.java:66) ~[SidedInvWrapper.class:?]
	at java.util.HashMap.hash(HashMap.java:338) ~[?:1.8.0_51]
	at java.util.HashMap.put(HashMap.java:611) ~[?:1.8.0_51]
	at java.util.HashSet.add(HashSet.java:219) ~[?:1.8.0_51]
	at mcjty.rftools.blocks.storagemonitor.StorageScannerTileEntity.inventoryAddNew(StorageScannerTileEntity.java:729) ~[StorageScannerTileEntity.class:?]
	at mcjty.rftools.blocks.storagemonitor.StorageScannerTileEntity.findInventories(StorageScannerTileEntity.java:706) ~[StorageScannerTileEntity.class:?]
	at mcjty.rftools.blocks.storagemonitor.PacketGetInventoryInfo.onMessageServer(PacketGetInventoryInfo.java:88) ~[PacketGetInventoryInfo.class:?]
	at mcjty.rftools.blocks.storagemonitor.PacketGetInventoryInfo$Handler.lambda$onMessage$1(PacketGetInventoryInfo.java:62) ~[PacketGetInventoryInfo$Handler.class:?]
	at mcjty.rftools.blocks.storagemonitor.PacketGetInventoryInfo$Handler$$Lambda$5792/571848174.run(Unknown Source) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_51]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_51]
	at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
	... 5 more
commented

Looks like this is actually a Forge bug that has gone unnoticed for a long time. I opened MinecraftForge/MinecraftForge#5787 to fix it there. I'd rather not add a hacky workaround here if possible.

commented

This is now fixed in upstream Forge, but a new 1.12.2 build with the fix hasn't been released yet. I'll update and close this once that happens.

commented

Fixed as of Forge 14.23.5.2839.