Class NPCRegistryTrainers
java.lang.Object
com.pixelmonmod.pixelmon.entities.npcs.registry.NPCRegistryTrainers
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets an NPC Trainer type from its name.getById
(int id) Gets an NPC Trainer type from its internal ID.static BaseTrainer
Gets an NPC Trainer type from its name descriptor.Gets a random NPC Trainer type.Gets a random NPC Trainer type from the types that have NPC Trainer data associated with them.getRandomData
(BaseTrainer trainer) Randomly selects a group of NPC Trainer data.getRandomData
(String name) Randomly selects a group of NPC Trainer data.getTranslatedData
(String langCode, BaseTrainer baseTrainer, String id) Retrieves a specific NPC Trainer type's data.getTranslatedRandomName
(String langCode, BaseTrainer baseTrainer, String id) Gets a random name for a specific NPC Trainer type.getTypes()
Gets all NPC Trainer data.boolean
Checks if there is a certain NPC Trainer type.
-
Field Details
-
Steve
The Steve NPC Trainer type.
-
-
Constructor Details
-
NPCRegistryTrainers
public NPCRegistryTrainers()
-
-
Method Details
-
has
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
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
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
Gets a random NPC Trainer type.- Returns:
- A random NPC Trainer type.
-
getRandomData
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
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
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
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
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
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
Gets all NPC Trainer data.- Returns:
- A list of data for all NPC Trainers.
-