During battle, an issue is experienced where both players will become stuck on the "Waiting..." prompt. This seems to coincide with a NullPointerException during the handling of a BagPacket.
Code: Select allCaused by: java.lang.NullPointerException
at com.pixelmonmod.pixelmon.battles.controller.BattleControllerBase.setUseItem(BattleControllerBase.java:1214) ~[BattleControllerBase.class:?]
at com.pixelmonmod.pixelmon.comm.packetHandlers.battles.BagPacket.bagPacket(BagPacket.java:86) ~[BagPacket.class:?]
at com.pixelmonmod.pixelmon.comm.packetHandlers.battles.BagPacket.access$000(BagPacket.java:17) ~[BagPacket.class:?]
at com.pixelmonmod.pixelmon.comm.packetHandlers.battles.BagPacket$Handler.onSyncMessage(BagPacket.java:119) ~[BagPacket$Handler.class:?]
at com.pixelmonmod.pixelmon.comm.packetHandlers.battles.BagPacket$Handler.onSyncMessage(BagPacket.java:115) ~[BagPacket$Handler.class:?]
at com.pixelmonmod.pixelmon.api.comm.ISyncHandler.lambda$onMessage$0(ISyncHandler.java:17) ~[ISyncHandler.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_191]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_191]
at net.minecraft.util.Util.func_181617_a(SourceFile:46) ~[h.class:?]
... 7 more
This corresponds to the second line of the method accepting an int as its final parameter:
Code: Select allBattleParticipant participant = (BattleParticipant)CollectionHelper.find(this.participants, (bp) -> bp.getType() == ParticipantType.Player && bp.getEntity() == user);
PixelmonWrapper userWrapper = participant.getPokemonFromUUID(pokemonUUID);
meaning that
is null.
Unforuntately I can't reproduce this consistently, so I'm unable to provide information as to
why the participant is not found - I would hazard a guess that comparing UUIDs instead of the raw entities in the predicate might help, since EntityPlayer objects are known to be unreliable in some cases when stored in the long term.