Class NPCRegistryTrainers

java.lang.Object
com.pixelmonmod.pixelmon.entities.npcs.registry.NPCRegistryTrainers

public class NPCRegistryTrainers extends Object
  • Field Details

    • Steve

      public static BaseTrainer Steve
      The Steve NPC Trainer type.
  • Constructor Details

    • NPCRegistryTrainers

      public NPCRegistryTrainers()
  • Method Details

    • has

      public boolean has(String trainerName)
      Checks if there is a certain NPC Trainer type.
      Parameters:
      trainerName - The name of the NPC Trainer type to find.
      Returns:
      True if is an NPC Trainer type with the specified name.
    • get

      public BaseTrainer get(String trainerName)
      Gets an NPC Trainer type from its name.
      Parameters:
      trainerName - The name of the NPC Trainer type to find.
      Returns:
      The NPC Trainer type with the specified name, or null if there isn't one.
    • getById

      public BaseTrainer getById(int id)
      Gets an NPC Trainer type from its internal ID.
      Parameters:
      id - The ID of the NPC Trainer type.
      Returns:
      The NPC Trainer type with the specified ID, or the Steve type if there isn't one.
    • getRandomBase

      public BaseTrainer getRandomBase()
      Gets a random NPC Trainer type.
      Returns:
      A random NPC Trainer type.
    • getRandomData

      public TrainerData getRandomData(BaseTrainer trainer)
      Randomly selects a group of NPC Trainer data.
      Parameters:
      trainer - The base trainer type to get data for.
      Returns:
      A randomly selected group of NPC Trainer data.
    • getRandomData

      public TrainerData getRandomData(String name)
      Randomly selects a group of NPC Trainer data.
      Parameters:
      name - The name of the NPC Trainer to get data for.
      Returns:
      A randomly selected group of NPC Trainer data.
    • getRandomBaseWithData

      public BaseTrainer getRandomBaseWithData()
      Gets a random NPC Trainer type from the types that have NPC Trainer data associated with them.
      Returns:
      A random NPC Trainer type from the types that have NPC Trainer data associated with them.
    • getByName

      public static BaseTrainer getByName(String name)
      Gets an NPC Trainer type from its name descriptor. This is more stable than using an ID as IDs change if we aren't careful on order of adding Trainers.
      Parameters:
      name - The name of the base Trainer type.
      Returns:
      The NPC Trainer type with the specified name, or the Steve type if there isn't one.
    • getTranslatedData

      public TrainerData getTranslatedData(String langCode, BaseTrainer baseTrainer, String id)
      Retrieves a specific NPC Trainer type's data.
      Parameters:
      langCode - The lang code to translate strings with.
      baseTrainer - The Trainer type to get data from.
      id - The ID of the Trainer type.
      Returns:
      The specified NPC Trainer type's data.
    • getTranslatedRandomName

      public String getTranslatedRandomName(String langCode, BaseTrainer baseTrainer, String id)
      Gets a random name for a specific NPC Trainer type.
      Parameters:
      langCode - The lang code to translate the name with.
      baseTrainer - The Trainer type to get a name for.
      id - The ID of the Trainer type.
      Returns:
      A random name for the specified NPC Trainer type, or "Steve" if the NPC Trainer type doesn't exist.
    • getTypes

      public ArrayList<BaseTrainer> getTypes()
      Gets all NPC Trainer data.
      Returns:
      A list of data for all NPC Trainers.