PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Conflict between Pneumaticcraft and Inventory Pets

nickick7x3 opened this issue · 4 comments

commented

Minecraft Version

1.12.2

Forge Version

1.12.2-14.23.2.2611

Mod Version

1.12.2-0.4.1-142

Describe your problem, including steps to reproduce it

Created a drone with the dig puzzle
Server crashes when a player loads the chunk the drone is in
Can only be fixed by spamming "/kill @e[type=pneumaticcraft:drone] when a player logs into that area
Ticking Entity exception

First 5 lines of the error report should show the error, I have attached the pastebin below.
"Description: Ticking entity

java.lang.RuntimeException: Slot 1 not in valid range - [0,1)
at net.minecraftforge.items.ItemStackHandler.validateSlotIndex(ItemStackHandler.java:210)
at net.minecraftforge.items.ItemStackHandler.getStackInSlot(ItemStackHandler.java:75)
at me.desht.pneumaticcraft.common.entity.living.EntityDrone$InventoryFakePlayer.func_70301_a(EntityDrone.java:1319)
at com.inventorypets.events.HarvestHandler.onPlayerBreaking(HarvestHandler.java:109)"

Any other comments?

For now it can be dealt with by disabling Inventory Pets, however this is not ideal.
Pastebin:
https://pastebin.com/02rXLZvM

commented

This isn't a conflict, it's a bug in Inventory Pets, and they need to fix it.

The mod isn't open source, but a quick look at the decompiled HarvestHandler class shows that Inventory Pets assumes the breaking player's inventory has (at least) 9 slots, which is not the case for drones (who use a Forge FakePlayer) - unless the drone has sufficient Dispenser Upgrades.

Inventory Pets needs to check the size of the inventory it's iterating over (using getSizeInventory()) and not assume the number of slots. This will break for any mod which uses a FakePlayer (whose inventory is less than 9 slots) to break blocks.

commented

Closing issue. Looks like Inventory Pets issue tracker is at https://github.com/capnkirok/Inventory-Pets/issues

commented
commented

By the way, as a temporary workaround (until Inventory Pets make that fix), adding 8 Dispenser Upgrades should get around the problem, since it will give the drone a large enough inventory to avoid the crash.