Class CosmeticsManager
java.lang.Object
com.storytimeproductions.stweaks.util.CosmeticsManager
Manages the loading and retrieval of cosmetic items from configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionCosmeticsManager
(org.bukkit.plugin.java.JavaPlugin plugin) Constructs a new CosmeticsManager and loads cosmetics from configuration. -
Method Summary
Modifier and TypeMethodDescriptionGets a list of all loaded cosmetics.static Cosmetic
getCosmetic
(String id) Gets a cosmetic by its unique identifier.static Cosmetic
Gets a cosmetic by its unique identifier.void
Loads all cosmetics from the configuration file into memory.
-
Constructor Details
-
CosmeticsManager
public CosmeticsManager(org.bukkit.plugin.java.JavaPlugin plugin) Constructs a new CosmeticsManager and loads cosmetics from configuration.- Parameters:
plugin
- the JavaPlugin instance
-
-
Method Details
-
loadCosmetics
public void loadCosmetics()Loads all cosmetics from the configuration file into memory. Invalid or incomplete cosmetics are skipped. -
getAllCosmetics
Gets a list of all loaded cosmetics.- Returns:
- a list of all Cosmetic objects
-
getCosmetic
Gets a cosmetic by its unique identifier.- Parameters:
id
- the cosmetic ID- Returns:
- the Cosmetic object, or null if not found
-
getCosmeticById
Gets a cosmetic by its unique identifier.- Parameters:
id
- the cosmetic ID- Returns:
- the Cosmetic object, or null if not found
-