Interface StarConfig
public interface StarConfig
Represents the main StarCosmetics Configuration.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddBlacklistedPlayer(@NotNull OfflinePlayer player) Adds a player to the blacklist.default voidaddBlacklistedSound(@NotNull Sound sound) Adds a sound to the blacklist.@NotNull StringFetches a String from the Language File.default StringFetches a String from the Language File.@NotNull List<OfflinePlayer>Fetches an immutable list of all of the players who cannot use cosmetics.Fetches an immutable list of all of the sounds unavailable for use in Custom Sound Events.longHow long, in ticks, a block cosmetic should last for.static @NotNull StarConfigFetches the StarConfig instance.static @NotNull FileConfigurationFetches the StarCosmetics Configuration.static @NotNull FileFetches the StarCosmetics Configuration File.static @NotNull FileFetches the StarCosmetics Custom Cosmetics File.@NotNull Set<CosmeticLocation<?>>Fetches all of the custom cosmetics found in cosmetics.yml.static @NotNull FileFetches the plugin's data folder.@NotNull Set<CosmeticLocation<?>>Fetches a list of all disabled cosmetics.longHow long, in ticks, an entity cosmetic should last for.intFetches the hard-coded internal maximum hologram text size limit.longHow long, in ticks, an item cosmetic should last for.@NotNull StringFetches the current Language.default @NotNull LocaleFetches the locale based ongetLanguage().static @NotNull LoggerFetches the StarCosmetics Logger.intFetches the maximum hologram text size limit.static @NotNull FileFetches the StarCosmetics Player Data Directory.static @NotNull PluginFetches the plugin.static @NotNull CosmeticRegistryFetches the StarCosmetics Cosmetic Registry.doubleFetches the requirement multiplier for all cosmetics.doublegetRequirementMultiplier(@Nullable CosmeticLocation<?> loc) Fetches the requirement multiplier for a specific cosmetic.getStructureReader(@NotNull File file) Fetches the current implementation of the StructureReader.getStructureReader(@NotNull InputStream stream) Fetches the current implementation of the StructureReader.getStructureReader(@NotNull Reader reader) Fetches the current implementation of the StructureReader.default StringgetWithArgs(String key, Object... args) Fetches a String from the Language File.default StringgetWithArgs(String key, String def, Object... args) Fetches a String from the Language File.booleanWhether pets can play their ambient sound.default booleanisBlacklisted(@Nullable OfflinePlayer player) Whether a player is blacklisted.default booleanisBlacklisted(@Nullable Sound sound) Whether a sound is blacklisted.static @NotNull FileConfigurationLoads the StarCosmetics Configuration.static @NotNull FileConfigurationLoads the StarCosmetics Custom Cosmetics File into a FileConfiguration.static voidPrints a Throwable in the StarCosmetics Logger.default voidremoveBlacklistedPlayer(@Nullable OfflinePlayer player) Removes a player from the blacklist.default voidremoveBlacklistedSound(@Nullable Sound sound) Removes a sound from the blacklist.voidsetAmbientPetSoundEnabled(boolean enabled) Sets whether pets can play their ambient sound.voidsetBlacklistedPlayers(@NotNull Iterable<? extends OfflinePlayer> players) Sets the list of blacklisted players.voidsetBlacklistedSounds(@NotNull Iterable<Sound> sounds) Sets the list of blacklisted sounds.voidsetBlockDisappearTime(long time) Sets how long, in ticks, a block cosmetic should last for.voidsetEntityDisappearTime(long time) Sets how long, in ticks, an entity cosmetic should last for.voidsetItemDisappearTime(long time) Sets how long, in ticks, an item cosmetic should last for.voidsetMaxHologramLimit(int limit) Sets the maximum hologram text size limit.voidsetRequirementMultiplier(double multiplier) Sets the requirement multiplier for all cosmetics.voidsetRequirementMultiplier(@Nullable CosmeticLocation<?> loc, double multiplier) Sets the requirement multiplier for a specific cosmetic.static voidUpdates the Plugin's Cache, removing any old data.voidUpdates the plugin's cached data, removing any old states.
-
Method Details
-
getPlugin
Fetches the plugin.- Returns:
- The plugin.
-
updateCache
static void updateCache()Updates the Plugin's Cache, removing any old data.- See Also:
-
getConfig
Fetches the StarConfig instance.- Returns:
- StarConfig Instance
-
print
Prints a Throwable in the StarCosmetics Logger.- Parameters:
t- Throwable to print.
-
getConfiguration
Fetches the StarCosmetics Configuration.- Returns:
- StarCosmetics Configuration
-
getDataFolder
Fetches the plugin's data folder.- Returns:
- Plugin's data folder.
-
getLogger
Fetches the StarCosmetics Logger.- Returns:
- StarCosmetics Logger
-
getConfigurationFile
Fetches the StarCosmetics Configuration File.- Returns:
- StarCosmetics Configuration File
-
loadConfig
Loads the StarCosmetics Configuration.- Returns:
- StarCosmetics Configuration
-
getCosmeticsFile
Fetches the StarCosmetics Custom Cosmetics File.- Returns:
- StarCosmetics Custom Cosmetics File
-
loadCosmeticsFile
Loads the StarCosmetics Custom Cosmetics File into a FileConfiguration.- Returns:
- StarCosmetics Custom Cosmetics File
-
getRegistry
Fetches the StarCosmetics Cosmetic Registry.- Returns:
- StarCosmetics Cosmetic Registry
-
getPlayerDirectory
Fetches the StarCosmetics Player Data Directory.- Returns:
- StarCosmetics Player Data Directory
-
getLanguage
Fetches the current Language.- Returns:
- Current Language
-
getLocale
Fetches the locale based ongetLanguage().- Returns:
- Language Locale
-
get
Fetches a String from the Language File.- Parameters:
key- Key to fetch.- Returns:
- String from the Language File according to the current Language
-
get
Fetches a String from the Language File.- Parameters:
key- Key to fetch.def- Default String to return if the key is not found.- Returns:
- String from the Language File according to the current Language
-
getWithArgs
Fetches a String from the Language File.- Parameters:
key- Key to fetch.args- Arguments to replace in the String.- Returns:
- String from the Language File according to the current Language
-
getWithArgs
Fetches a String from the Language File.- Parameters:
key- Key to fetch.def- Default String to return if the key is not found.args- Arguments to replace in the String.- Returns:
- String from the Language File according to the current Language
-
updatePluginCache
void updatePluginCache()Updates the plugin's cached data, removing any old states. -
getEntityDisappearTime
long getEntityDisappearTime()How long, in ticks, an entity cosmetic should last for.- Returns:
- Entity Cosmetic Duration
-
setEntityDisappearTime
Sets how long, in ticks, an entity cosmetic should last for.- Parameters:
time- Entity Cosmetic Duration- Throws:
IllegalArgumentException- if time is not positive
-
getItemDisappearTime
long getItemDisappearTime()How long, in ticks, an item cosmetic should last for.- Returns:
- Item Cosmetic Duration
-
setItemDisappearTime
Sets how long, in ticks, an item cosmetic should last for.- Parameters:
time- Item Cosmetic Duration- Throws:
IllegalArgumentException- if time is not positive
-
getBlockDisappearTime
long getBlockDisappearTime()How long, in ticks, a block cosmetic should last for.- Returns:
- Item Cosmetic Duration
-
setBlockDisappearTime
Sets how long, in ticks, a block cosmetic should last for.- Parameters:
time- Item Cosmetic Duration- Throws:
IllegalArgumentException- if time is not positive
-
getStructureReader
Fetches the current implementation of the StructureReader.- Parameters:
file- File to Read- Returns:
- StructureReader
-
getStructureReader
Fetches the current implementation of the StructureReader.- Parameters:
stream- InputStream to Read- Returns:
- StructureReader
-
getStructureReader
Fetches the current implementation of the StructureReader.- Parameters:
reader- Reader to Read- Returns:
- StructureReader
-
getDisabledCosmetics
Fetches a list of all disabled cosmetics.- Returns:
- Disabled Cosmetics
-
isAmbientPetSoundEnabled
boolean isAmbientPetSoundEnabled()Whether pets can play their ambient sound.- Returns:
- true if enabled, else false
-
setAmbientPetSoundEnabled
void setAmbientPetSoundEnabled(boolean enabled) Sets whether pets can play their ambient sound.- Parameters:
enabled- true if enabled, else false
-
getRequirementMultiplier
double getRequirementMultiplier()Fetches the requirement multiplier for all cosmetics.- Returns:
- Requirement Multiplier
-
getRequirementMultiplier
Fetches the requirement multiplier for a specific cosmetic.- Parameters:
loc- Cosmetic Location- Returns:
- Requirement Multiplier
-
setRequirementMultiplier
void setRequirementMultiplier(double multiplier) Sets the requirement multiplier for all cosmetics.- Parameters:
multiplier- Requirement Multiplier
-
setRequirementMultiplier
Sets the requirement multiplier for a specific cosmetic.- Parameters:
loc- Cosmetic Locationmultiplier- Requirement Multiplier
-
getBlacklistedPlayers
Fetches an immutable list of all of the players who cannot use cosmetics.- Returns:
- Blacklisted Players
-
addBlacklistedPlayer
Adds a player to the blacklist.- Parameters:
player- Player to add
-
removeBlacklistedPlayer
Removes a player from the blacklist.- Parameters:
player- Player to remove
-
isBlacklisted
Whether a player is blacklisted.- Parameters:
player- Player to check- Returns:
- true if blacklisted, else false
-
setBlacklistedPlayers
Sets the list of blacklisted players.- Parameters:
players- Blacklisted Players
-
getBlacklistedSounds
Fetches an immutable list of all of the sounds unavailable for use in Custom Sound Events.- Returns:
- Blacklisted Sounds
-
addBlacklistedSound
Adds a sound to the blacklist.- Parameters:
sound- Sound to add
-
removeBlacklistedSound
Removes a sound from the blacklist.- Parameters:
sound- Sound to remove
-
isBlacklisted
Whether a sound is blacklisted.- Parameters:
sound- Sound to check- Returns:
- true if blacklisted, else false
-
setBlacklistedSounds
Sets the list of blacklisted sounds.- Parameters:
sounds- Blacklisted Sounds
-
getCustomCosmetics
Fetches all of the custom cosmetics found in cosmetics.yml.- Returns:
- Set of Custom Cosmetics
-
getInternalMaxHologramLimit
int getInternalMaxHologramLimit()Fetches the hard-coded internal maximum hologram text size limit.In 1.9 until 1.13, this is 16. From 1.13 ownard, this is 48.
- Returns:
- Internal Maximum Hologram Text Size Limit
-
getMaxHologramLimit
int getMaxHologramLimit()Fetches the maximum hologram text size limit.- Returns:
- Maximum Hologram Text Size Limit
-
setMaxHologramLimit
void setMaxHologramLimit(int limit) Sets the maximum hologram text size limit.- Parameters:
limit- Maximum Hologram Text Size Limit
-