Environment
- Minecraft: 1.20.1
- Loader: Forge 47.4.9
- AppliedE: 0.14.3
- ProjectE: 1.0.1
- Applied Energistics 2: 15.4.10
- AE Omni Cells: 1.1.1 (the addon whose cell ends up throwing)
- ExtendedAE (provides
GuiExDrive)
What happens
Player opens an ExtendedAE Drive GUI and hovers a slot. ProjectE's ToolTipEvent fires, AppliedE's InventoryItemProcessor.recalculateEMC walks the hovered cell's MEStorage, and the iteration crashes with an NPE coming out of fastutil internals.
Full crash log (mclo.gs raw): https://api.mclo.gs/1/raw/BsWtZbV
Exception
java.lang.NullPointerException: Cannot invoke "it.unimi.dsi.fastutil.objects.ObjectArrayList.get(int)" because "this.wrapped" is null
at it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap$MapIterator.nextEntry(Object2LongOpenHashMap.java:705)
at it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap$EntryIterator.next(Object2LongOpenHashMap.java:797)
at com.wintercogs.ae2omnicells.common.me.AEUniversalCellInventory.getAvailableStacks(AEUniversalCellInventory.java:389)
at appeng.api.storage.MEStorage.getAvailableStacks(MEStorage.java:110)
at gripe._90.appliede.emc.InventoryItemProcessor.recalculateEMC(InventoryItemProcessor.java:54)
at moze_intel.projecte.emc.nbt.NBTManager.getEmcValue(NBTManager.java:68)
at moze_intel.projecte.utils.EMCHelper.getEmcValue(EMCHelper.java:151)
at moze_intel.projecte.events.ToolTipEvent.tTipEvent(ToolTipEvent.java:52)
Why I'm filing this against AppliedE too
The immediate bug is on the AE Omni Cells side (their storage map isn't safe against concurrent iteration — I've filed an issue there: https://github.com/Frostbite-time/AE2OmniCells/issues — please link once available). The fastutil wrapped-null pattern is the textbook signature of "map mutated while an iterator was alive".
But InventoryItemProcessor.recalculateEMC is what triggered the iteration here, from the client render thread (ToolTipEvent). Walking a live MEStorage from the render thread is fragile by design — every cell-providing addon (Mega Cells, ExtraCells, AE Omni Cells, Functional Storage shims, etc.) is a candidate for the same crash class as soon as their storage is sync'd off-thread.
It would be worth considering, on AppliedE's side, one of:
- Snapshot the cell contents before iterating (copy
KeyCounter/the underlying map under a try/catch, then process the snapshot).
- Wrap the
getAvailableStacks call in a try/catch that logs once and returns "no EMC" for that tooltip — a busted addon shouldn't crash the client.
- Run EMC recalculation off the render thread and cache the result; tooltip just reads the cached value.
Option 2 alone would already turn this from "client crash" into "tooltip is missing EMC for a tick", which is a much more acceptable failure mode given the cross-mod surface area AppliedE has to deal with.
Repro
- MC 1.20.1 / Forge / ProjectE / AppliedE 0.14.3 / AE2 / AE Omni Cells 1.1.1 / ExtendedAE.
- Put any Universal Cell from AE Omni Cells into an ExtendedAE Drive on a network with content flowing.
- Open the drive GUI and hover the cell slot — instant crash (intermittent, more likely while the cell is being written to).
Workarounds for users hitting this
- Don't hover slots in an ExtendedAE Drive containing Universal Cells, or
- Temporarily disable AppliedE while removing the cell.
Environment
GuiExDrive)What happens
Player opens an ExtendedAE Drive GUI and hovers a slot. ProjectE's
ToolTipEventfires, AppliedE'sInventoryItemProcessor.recalculateEMCwalks the hovered cell'sMEStorage, and the iteration crashes with an NPE coming out of fastutil internals.Full crash log (mclo.gs raw): https://api.mclo.gs/1/raw/BsWtZbV
Exception
Why I'm filing this against AppliedE too
The immediate bug is on the AE Omni Cells side (their
storagemap isn't safe against concurrent iteration — I've filed an issue there: https://github.com/Frostbite-time/AE2OmniCells/issues — please link once available). The fastutilwrapped-null pattern is the textbook signature of "map mutated while an iterator was alive".But
InventoryItemProcessor.recalculateEMCis what triggered the iteration here, from the client render thread (ToolTipEvent). Walking a liveMEStoragefrom the render thread is fragile by design — every cell-providing addon (Mega Cells, ExtraCells, AE Omni Cells, Functional Storage shims, etc.) is a candidate for the same crash class as soon as their storage is sync'd off-thread.It would be worth considering, on AppliedE's side, one of:
KeyCounter/the underlying map under a try/catch, then process the snapshot).getAvailableStackscall in a try/catch that logs once and returns "no EMC" for that tooltip — a busted addon shouldn't crash the client.Option 2 alone would already turn this from "client crash" into "tooltip is missing EMC for a tick", which is a much more acceptable failure mode given the cross-mod surface area AppliedE has to deal with.
Repro
Workarounds for users hitting this