Class EnforcedSwitchTask
java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.battles.tasks.BattleTaskPacket
com.pixelmonmod.pixelmon.battles.tasks.BattleMessagePacket
com.pixelmonmod.pixelmon.battles.tasks.EnforcedSwitchTask
- All Implemented Interfaces:
PixelmonPacket
Created by Jay113355 on 2/28/2021.
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for packet registration.EnforcedSwitchTask(int switchPosition) Initializes a packet to switch out a Pokémon at a specified position.EnforcedSwitchTask(int switchPosition, boolean preventFleeOnSwitch) -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(net.minecraft.network.FriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoidencode(net.minecraft.network.FriendlyByteBuf buffer) Encodes the buffer with the packet informationnet.minecraft.network.chat.ComponentGets the UUID of thePokemonthis message affectsbooleanWill be called once per frame until you return false.Methods inherited from class com.pixelmonmod.pixelmon.battles.tasks.BattleMessagePacket
isRead, markAsReadMethods inherited from class com.pixelmonmod.pixelmon.battles.tasks.BattleTaskPacket
handlePacket, shouldRunParallelMethods inherited from class com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
handle, reply
-
Constructor Details
-
EnforcedSwitchTask
public EnforcedSwitchTask()Empty constructor for packet registration. -
EnforcedSwitchTask
public EnforcedSwitchTask(int switchPosition) Initializes a packet to switch out a Pokémon at a specified position.- Parameters:
switchPosition- The position of the Pokémon switching out.
-
EnforcedSwitchTask
public EnforcedSwitchTask(int switchPosition, boolean preventFleeOnSwitch)
-
-
Method Details
-
getMessage
public net.minecraft.network.chat.Component getMessage()- Overrides:
getMessagein classBattleMessagePacket
-
process
Description copied from class:BattleTaskPacketWill be called once per frame until you return false.- Overrides:
processin classBattleMessagePacket- Returns:
- true if you should continue being updated. false otherwise.
-
getPokemonID
Description copied from class:BattleTaskPacketGets the UUID of thePokemonthis message affects- Overrides:
getPokemonIDin classBattleMessagePacket- Returns:
- the uuid of the pokemon this message affects, or null.
-
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:PixelmonPacketEncodes the buffer with the packet information- Specified by:
encodein interfacePixelmonPacket- Overrides:
encodein classBattleMessagePacket- Parameters:
buffer- The buffer being encoded
-
decode
public void decode(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:PixelmonPacketDecodes the information from the buffer to the packet instance- Specified by:
decodein interfacePixelmonPacket- Overrides:
decodein classBattleMessagePacket- Parameters:
buffer- The buffer being decoded
-