Class SetTrainerData

java.lang.Object
com.pixelmonmod.pixelmon.comm.SetTrainerData

public class SetTrainerData extends Object
Holder for NPC Trainer data.
  • Field Details

    • name

      public String name
      The NPC Trainer's name.
    • greeting

      public String greeting
      The NPC Trainer's messages.
    • win

      public String win
      The NPC Trainer's messages.
    • lose

      public String lose
      The NPC Trainer's messages.
    • winnings

      public net.minecraft.world.item.ItemStack[] winnings
      The items won upon the NPC Trainer's defeat.
    • id

      public int id
      The NPC Trainer's ID.
    • winMoney

      public int winMoney
      The money won upon the NPC Trainer's defeat.
    • rules

      public BattleRules rules
      The rules that the NPC Trainer uses in battle.
  • Constructor Details

    • SetTrainerData

      public SetTrainerData()
      Empty constructor used for registering the packet.
    • SetTrainerData

      public SetTrainerData(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings)
      Initializes the NPC Trainer data.
      Parameters:
      name - The name of the NPC Trainer.
      greeting - The greeting said by the NPC Trainer when starting a battle.
      win - The message said by the NPC Trainer upon victory.
      lose - The message said by the NPC Trainer upon losing.
      winMoney - The amount of PokeDollars won when the NPC Trainer is defeated.
      winnings - The items won when the NPC Trainer is defeated.
    • SetTrainerData

      public SetTrainerData(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings, BattleRules rules)
      Initializes the NPC Trainer data.
      Parameters:
      name - The name of the NPC Trainer.
      greeting - The greeting said by the NPC Trainer when starting a battle.
      win - The message said by the NPC Trainer upon victory.
      lose - The message said by the NPC Trainer upon losing.
      winMoney - The amount of PokeDollars won when the NPC Trainer is defeated.
      winnings - The items won when the NPC Trainer is defeated.
      rules - The rules that the NPC Trainer uses in battle, or null if they should not be sent in the packet.
    • SetTrainerData

      public SetTrainerData(NPCTrainer trainer, String localization)
      Initializes the NPC Trainer data.
      Parameters:
      trainer - The NPC Trainer to get data from.
      localization - The localization code for the lang file to translate data from.
  • Method Details

    • encodeInto

      public void encodeInto(net.minecraft.network.FriendlyByteBuf buffer)
      Encodes the data into a buffer.
      Parameters:
      buffer - The buffer to encode the data into.
    • decodeInto

      public void decodeInto(net.minecraft.network.FriendlyByteBuf buffer)
      Decodes the data from a buffer.
      Parameters:
      buffer - The buffer to decode the data from.