Class StartBattlePacket
java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.comm.packetHandlers.battles.StartBattlePacket
- All Implemented Interfaces:
PixelmonPacket
Displays the battle GUI client-side.
-
Constructor Summary
ConstructorDescriptionEmpty constructor for packet registration.StartBattlePacket
(int battleIndex, ParticipantType[][] type, int afkActivate, int afkTurn, int catchCombo, BattleRules rules) Initializes a battle start packet.StartBattlePacket
(int battleIndex, ParticipantType[][] type, BattleRules rules) Initializes a battle start packet. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decode
(net.minecraft.network.FriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoid
encode
(net.minecraft.network.FriendlyByteBuf buffer) Encodes the buffer with the packet informationprotected void
handlePacket
(net.minecraftforge.event.network.CustomPayloadEvent.Context context) Methods inherited from class com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
handle, reply
-
Constructor Details
-
StartBattlePacket
public StartBattlePacket()Empty constructor for packet registration. -
StartBattlePacket
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 interfacePixelmonPacket
- Overrides:
encode
in classAbstractPixelmonPacket
- 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 interfacePixelmonPacket
- Overrides:
decode
in classAbstractPixelmonPacket
- Parameters:
buffer
- The buffer being decoded
-
handlePacket
protected void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context) - Specified by:
handlePacket
in classAbstractPixelmonPacket
-