Class StartBattlePacket

java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.comm.packetHandlers.battles.StartBattlePacket
All Implemented Interfaces:
PixelmonPacket

public class StartBattlePacket extends AbstractPixelmonPacket
Displays the battle GUI client-side.
  • Constructor Details

    • StartBattlePacket

      public StartBattlePacket()
      Empty constructor for packet registration.
    • StartBattlePacket

      public StartBattlePacket(int battleIndex, ParticipantType[][] type, BattleRules rules)
      Initializes a battle start packet.
      Parameters:
      battleIndex - The index of the battle that the player is in.
      type - The types of participants in the battle.
      rules - The rules to use for the battle.
    • StartBattlePacket

      public StartBattlePacket(int battleIndex, ParticipantType[][] type, int afkActivate, int afkTurn, int catchCombo, BattleRules rules)
      Initializes a battle start packet.
      Parameters:
      battleIndex - The index of the battle that the player is in.
      type - The types of participants in the battle.
      afkActivate - The amount of time before the AFK handler takes over.
      afkTurn - The amount of time before the AFK handler makes a move.
      catchCombo - The current catch combo, or 0 if none.
      rules - The rules to use for the battle.
  • Method Details

    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Encodes the buffer with the packet information
      Specified by:
      encode in interface PixelmonPacket
      Overrides:
      encode in class AbstractPixelmonPacket
      Parameters:
      buffer - The buffer being encoded
    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Decodes the information from the buffer to the packet instance
      Specified by:
      decode in interface PixelmonPacket
      Overrides:
      decode in class AbstractPixelmonPacket
      Parameters:
      buffer - The buffer being decoded
    • handlePacket

      protected void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
      Specified by:
      handlePacket in class AbstractPixelmonPacket