Class BattleTaskPacket

java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.battles.tasks.BattleTaskPacket
All Implemented Interfaces:
PixelmonPacket, net.minecraft.network.protocol.common.custom.CustomPacketPayload
Direct Known Subclasses:
BattleMessagePacket, FailedSwitchFleeTask, HPIncreaseTask, HPUpdateTask, RaidDropsTask, RaidDynamaxTask, RaidShieldsTask, StatusUpdateTask, SwitchOutTask

public abstract class BattleTaskPacket extends AbstractPixelmonPacket
Implement BattleMessagePacket if you have a message that goes along with this task.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B extends net.minecraft.network.FriendlyByteBuf>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B extends net.minecraft.network.FriendlyByteBuf,T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract UUID
    Gets the UUID of the Pokemon this message affects
    protected void
    handlePacket(net.neoforged.neoforge.network.handling.IPayloadContext context)
     
    abstract boolean
    Will be called once per frame until you return false.
    boolean
    If this returns true the gui will not wait to complete this task before running the next task in queue.

    Methods inherited from class com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket

    decode, encode, handle, reply

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    toVanillaClientbound, toVanillaServerbound

    Methods inherited from interface com.pixelmonmod.pixelmon.comm.data.PixelmonPacket

    decode, encode, type
  • Constructor Details

    • BattleTaskPacket

      public BattleTaskPacket()
  • Method Details

    • process

      public abstract boolean process(ClientBattleManager bm)
      Will be called once per frame until you return false.
      Returns:
      true if you should continue being updated. false otherwise.
    • getPokemonID

      @Nullable public abstract UUID getPokemonID()
      Gets the UUID of the Pokemon this message affects
      Returns:
      the uuid of the pokemon this message affects, or null.
    • shouldRunParallel

      public boolean shouldRunParallel()
      If this returns true the gui will not wait to complete this task before running the next task in queue. This task will not run at the same time as another parallel task with the same pokemonID
      Returns:
      if the task should run parallel
    • handlePacket

      protected void handlePacket(net.neoforged.neoforge.network.handling.IPayloadContext context)
      Specified by:
      handlePacket in class AbstractPixelmonPacket