Class PetsManager
java.lang.Object
com.storytimeproductions.stweaks.util.PetsManager
Manages the loading and retrieval of pets from the pets.yml configuration file. This class
handles parsing the configuration, validating pet data, and providing access to the loaded pets.
-
Constructor Summary
ConstructorsConstructorDescriptionPetsManager
(org.bukkit.plugin.java.JavaPlugin plugin) Constructs a PetsManager instance. -
Method Summary
Modifier and TypeMethodDescriptiongetPetById
(String petId) Retrieves a Pet by its ID.getPetByItem
(org.bukkit.inventory.ItemStack item) Returns the Pet corresponding to the given item if it has a hotbar_pets model, or null otherwise.void
loadPets()
Loads pets from the pets.yml configuration file.
-
Constructor Details
-
PetsManager
public PetsManager(org.bukkit.plugin.java.JavaPlugin plugin) Constructs a PetsManager instance.- Parameters:
plugin
- The main plugin instance.
-
-
Method Details
-
getPetByItem
Returns the Pet corresponding to the given item if it has a hotbar_pets model, or null otherwise. -
loadPets
public void loadPets()Loads pets from the pets.yml configuration file. -
getPetById
Retrieves a Pet by its ID.- Parameters:
petId
- The ID of the pet to retrieve.- Returns:
- The Pet object if found, otherwise null.
-
getAllPets
-