Class NPCServerPacket

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

public class NPCServerPacket extends AbstractPixelmonPacket
Sends data related to NPC editing to the server.
  • 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

      public NPCServerPacket(int npcID, EnumTrainerAI ai)
      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

      public NPCServerPacket(int npcID, BattleAIMode battleAI)
      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

      public NPCServerPacket(int npcID, BossTier bm)
      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

      public NPCServerPacket(int npcID, EnumEncounterMode bm)
      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

      public NPCServerPacket(int npcID, EnumMegaItemsUnlocked mi)
      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

      public NPCServerPacket(int npcID, EnumOldGenMode og)
      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

      public NPCServerPacket(int npcID, BattleRules battleRules)
      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

      public NPCServerPacket(int npcID, EnumNPCServerPacketType mode, String data)
      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

      public NPCServerPacket(int npcID, Species pokemon, int pos)
      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

      public NPCServerPacket(int npcID, EnumNPCServerPacketType mode, int textureIndex)
      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

      public NPCServerPacket(int npcID, EnumNPCServerPacketType mode)
      Initializes a packet to change an NPC.
      Parameters:
      npcID - The ID of the NPC to edit.
      mode - The type of packet.
    • NPCServerPacket

      public NPCServerPacket(int npcID, ClientNPCData npcData)
      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

      public NPCServerPacket(int npcID, ArrayList<String> pages)
      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

      public NPCServerPacket(int npcID, int engageDistance, EnumNPCServerPacketType type)
      Initializes a packet to change the NPC's engage distance
      Parameters:
      npcID - The ID of the NPC to edit.
      engageDistance - The new engage distance
      type - 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 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