
NullPointerException on machine extract
nefarious411 opened this issue ยท 3 comments
- Forge Version: forge-13.20.0.2296
- Calculator Version: 1.11.2-4.0.0
- SonarCore Version: 1.11.2-4.0.0
- Multiplayer or Singleplayer: Single player
- Crash Report Link: N/A
- Affected Features: extracting from machines
- Description: Trying to automate any of the machines such as Docking Station, any of the chambers, etc. Inserting seems to work just fine, but when extracting I'm getting a NullPointerException as seen in this stacktrace:
Stacktrace:
java.lang.NullPointerException: The validated object is null
at org.apache.commons.lang3.Validate.notNull(Validate.java:222)
at org.apache.commons.lang3.Validate.notNull(Validate.java:203)
at net.minecraft.util.NonNullList.set(SourceFile:45)
at sonar.core.inventory.AbstractSonarInventory.func_70299_a(AbstractSonarInventory.java:118)
at sonar.core.helpers.InventoryHelper.removeStack(InventoryHelper.java:69)
at sonar.core.inventory.AbstractSonarInventory.extractItem(AbstractSonarInventory.java:196)
at sonar.core.inventory.SonarInventory.extractItem(SonarInventory.java:50)
at sonar.core.inventory.AbstractSonarInventory$EmbeddedHandler.extractItem(AbstractSonarInventory.java:53)
at net.minecraftforge.items.VanillaInventoryCodeHooks.extractHook(VanillaInventoryCodeHooks.java:65)
at net.minecraft.tileentity.TileEntityHopper.func_145891_a(TileEntityHopper.java:301)
at net.minecraft.tileentity.TileEntityHopper.func_145887_i(TileEntityHopper.java:142)
at net.minecraft.tileentity.TileEntityHopper.func_73660_a(TileEntityHopper.java:122)
I've tried multiple mods for inventory extraction from Extra Utilities 2 transfer nodes to vanilla hoppers (from stack trace above).
From looking through code, I am assuming that since stack.getCount() == 0
in InventoryHelper and stack is getting set to null, it's not dealt with very well when getting back into AbstractSonarInventory.setInventorySlotContents: this.slots.set(index, stack);
Since this.slots is a NonNullList, the validation complains, thus not allowing extraction to occur.
The behavior can be seen in one of my videos: 3:02 in this: https://youtu.be/1lHmZKwT4gQ?t=182
Think I may have a fix, but want to test first. Any info on how to build it? I'm missing dependencies for other mod interactions such as mcmultipart, minetweaker, AE2, etc.