Class NPCServerPacket
java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.comm.packetHandlers.npc.NPCServerPacket
- All Implemented Interfaces:
PixelmonPacket
Sends data related to NPC editing to the server.
-
Constructor Summary
ConstructorDescriptionNPCServerPacket
(int npcID) Initializes a packet with a Trainer ID.NPCServerPacket
(int npcID, int modelIndex) Initializes a packet to change the NPC's model.NPCServerPacket
(int npcID, int engageDistance, EnumNPCServerPacketType type) Initializes a packet to change the NPC's engage distanceNPCServerPacket
(int npcID, PokemonSpecification offer, PokemonSpecification exchange, String description) Initializes a packet to change a trader's transaction.NPCServerPacket
(int npcID, BattleAIMode battleAI) Initializes a packet the change a Trainer's battle AI mode.NPCServerPacket
(int npcID, BossTier bm) Initializes a packet to change a Trainer's boss mode.NPCServerPacket
(int npcID, Species pokemon, int pos) Initializes a packet to add a Pokémon to the Trainer's party.NPCServerPacket
(int npcID, BattleRules battleRules) Initializes a packet to change a Trainer's battle type.NPCServerPacket
(int npcID, EnumNPCServerPacketType mode) Initializes a packet to change an NPC.NPCServerPacket
(int npcID, EnumNPCServerPacketType mode, int textureIndex) Initializes a packet to change an NPC's texture.NPCServerPacket
(int npcID, EnumNPCServerPacketType mode, String data) Initializes a packet to send a string.NPCServerPacket
(int npcID, ClientNPCData npcData) Initializes a packet to change an NPC's texture.NPCServerPacket
(int npcID, EnumEncounterMode bm) Initializes a packet to change a Trainer's encounter mode.NPCServerPacket
(int npcID, EnumMegaItemsUnlocked mi) Initializes a packet to change a Trainer's mega item.NPCServerPacket
(int npcID, EnumOldGenMode og) Initializes a packet to change a Trainer's old gen mode.NPCServerPacket
(int npcID, EnumTrainerAI ai) Initializes a packet to change a Trainer's AI.NPCServerPacket
(int npcID, ArrayList<String> pages) Initializes a packet to change a chatting NPC's dialogue. -
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
-
NPCServerPacket
public NPCServerPacket() -
NPCServerPacket
public NPCServerPacket(int npcID) Initializes a packet with a Trainer ID.- Parameters:
npcID
- The ID of the Trainer being edited.
-
NPCServerPacket
Initializes a packet to change a Trainer's AI.- Parameters:
npcID
- The ID of the Trainer to edit.ai
- The new AI to set the Trainer to.
-
NPCServerPacket
Initializes a packet the change a Trainer's battle AI mode.- Parameters:
npcID
- The ID of the Trainer to edit.battleAI
- The new battle AI mode to set the Trainer to.
-
NPCServerPacket
Initializes a packet to change a Trainer's boss mode.- Parameters:
npcID
- The ID of the Trainer to edit.bm
- The new boss mode to set the Trainer to.
-
NPCServerPacket
Initializes a packet to change a Trainer's encounter mode.- Parameters:
npcID
- The ID of the Trainer to edit.bm
- The new encounter mode to set the Trainer to.
-
NPCServerPacket
Initializes a packet to change a Trainer's mega item.- Parameters:
npcID
- The ID of the Trainer to edit.mi
- The new mega item to set the Trainer to.
-
NPCServerPacket
Initializes a packet to change a Trainer's old gen mode.- Parameters:
npcID
- The ID of the Trainer to edit.og
- The new old gen mode to set the Trainer to.
-
NPCServerPacket
Initializes a packet to change a Trainer's battle type.- Parameters:
npcID
- The ID of the Trainer to edit.battleRules
- The new battle rules.
-
NPCServerPacket
public NPCServerPacket(int npcID, int modelIndex) Initializes a packet to change the NPC's model.- Parameters:
npcID
- The ID of the NPC to edit.modelIndex
- The index of the model to set the NPC to.
-
NPCServerPacket
Initializes a packet to send a string.- Parameters:
npcID
- The ID of the NPC to edit.mode
- The type of packet.data
- The string data to send.
-
NPCServerPacket
Initializes a packet to add a Pokémon to the Trainer's party.- Parameters:
npcID
- The ID of the Trainer to edit.pokemon
- The Pokémon to add.pos
- The party position of the new Pokémon.
-
NPCServerPacket
Initializes a packet to change an NPC's texture.- Parameters:
npcID
- The ID of the NPC to edit.mode
- The type of packet.textureIndex
- The index of the new texture to set the NPC to.
-
NPCServerPacket
Initializes a packet to change an NPC.- Parameters:
npcID
- The ID of the NPC to edit.mode
- The type of packet.
-
NPCServerPacket
Initializes a packet to change an NPC's texture.- Parameters:
npcID
- The ID of the NPC to edit.npcData
- Data for the texture to change the NPC to.
-
NPCServerPacket
Initializes a packet to change a chatting NPC's dialogue.- Parameters:
npcID
- The ID of the chatting NPC to edit.pages
- The new dialogue of the chatting NPC.
-
NPCServerPacket
public NPCServerPacket(int npcID, PokemonSpecification offer, PokemonSpecification exchange, String description) Initializes a packet to change a trader's transaction.- Parameters:
npcID
- The ID of the trader to edit.offer
- The Pokémon offered by the trader.exchange
- The Pokémon requested by the trader.
-
NPCServerPacket
Initializes a packet to change the NPC's engage distance- Parameters:
npcID
- The ID of the NPC to edit.engageDistance
- The new engage distancetype
- The type of the packet
-
-
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
-