Pixelmon Mod - Bug tracker

[7.0.8] Perpetual "waiting" during battle due to NullPointerException fix completed

Ticket description:
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
Code: Select allparticipant
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.

Comments

#19526 Posted by LordSamosa » 10 May 2020 10:25

This ticket is expired. If you believe this is still an issue, please make a new ticket.

Ticket details

  • Ticket ID: 14139
  • Project: Pixelmon Mod
  • Status: Fix completed
  • Component: Battle
  • Project version: 7.x.x
  • Priority: Normal
  • Severity: Normal
  • Forge/Sponge: Forge 14.23.5.2838, SpongeForge 7.1.6-RC3616
  • What else would be useful to know?: (unknown)
  • Assigned to: (unassigned)
  • Reported by: caseif (Send PM)
  • Reporter's tickets: (List all tickets)
  • Reported on: 10 Oct 2019 10:39
  • Ticket last visited by: LordSamosa on 10 May 2020 10:24
JOIN THE TEAM