Interface StarConfig


public interface StarConfig
Represents the main StarCosmetics Configuration.
  • Method Details

    • getPlugin

      @NotNull static @NotNull Plugin getPlugin()
      Fetches the plugin.
      Returns:
      The plugin.
    • updateCache

      static void updateCache()
      Updates the Plugin's Cache, removing any old data.
      See Also:
    • getConfig

      @NotNull static @NotNull StarConfig getConfig()
      Fetches the StarConfig instance.
      Returns:
      StarConfig Instance
    • print

      static void print(@NotNull @NotNull Throwable t)
      Prints a Throwable in the StarCosmetics Logger.
      Parameters:
      t - Throwable to print.
    • getConfiguration

      @NotNull static @NotNull FileConfiguration getConfiguration()
      Fetches the StarCosmetics Configuration.
      Returns:
      StarCosmetics Configuration
    • getDataFolder

      @NotNull static @NotNull File getDataFolder()
      Fetches the plugin's data folder.
      Returns:
      Plugin's data folder.
    • getLogger

      @NotNull static @NotNull Logger getLogger()
      Fetches the StarCosmetics Logger.
      Returns:
      StarCosmetics Logger
    • getConfigurationFile

      @NotNull static @NotNull File getConfigurationFile()
      Fetches the StarCosmetics Configuration File, whether it exists or not.
      Returns:
      StarCosmetics Configuration File
    • loadConfig

      @NotNull static @NotNull FileConfiguration loadConfig()
      Loads the StarCosmetics Configuration.
      Returns:
      StarCosmetics Configuration
    • getCosmeticsFile

      @NotNull static @NotNull File getCosmeticsFile()
      Fetches the StarCosmetics Custom Cosmetics File.
      Returns:
      StarCosmetics Custom Cosmetics File
    • loadCosmeticsFile

      @NotNull static @NotNull FileConfiguration loadCosmeticsFile()
      Loads the StarCosmetics Custom Cosmetics File into a FileConfiguration.
      Returns:
      StarCosmetics Custom Cosmetics File
    • getRegistry

      @NotNull static @NotNull CosmeticRegistry getRegistry()
      Fetches the StarCosmetics Cosmetic Registry.
      Returns:
      StarCosmetics Cosmetic Registry
    • getPlayerDirectory

      @NotNull static @NotNull File getPlayerDirectory()
      Fetches the StarCosmetics Player Data Directory.
      Returns:
      StarCosmetics Player Data Directory
    • getLanguage

      @NotNull @NotNull String getLanguage()
      Fetches the current Language.
      Returns:
      Current Language
    • setLanguage

      @NotNull void setLanguage(@NotNull @NotNull String language)
      Sets the current Language.
      Parameters:
      language - Language ID to set
    • getLocale

      @NotNull default @NotNull Locale getLocale()
      Fetches the locale based on getLanguage().
      Returns:
      Language Locale
    • get

      @NotNull @NotNull String get(String key)
      Fetches a String from the Language File.
      Parameters:
      key - Key to fetch.
      Returns:
      String from the Language File according to the current Language
    • get

      default String get(String key, String def)
      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

      default String getWithArgs(String key, Object... args)
      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

      default String getWithArgs(String key, String def, Object... args)
      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

      void setEntityDisappearTime(long time) throws IllegalArgumentException
      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

      void setItemDisappearTime(long time) throws IllegalArgumentException
      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

      void setBlockDisappearTime(long time) throws IllegalArgumentException
      Sets how long, in ticks, a block cosmetic should last for.
      Parameters:
      time - Item Cosmetic Duration
      Throws:
      IllegalArgumentException - if time is not positive
    • getStructureReader

      StructureReader getStructureReader(@NotNull @NotNull File file)
      Fetches the current implementation of the StructureReader.
      Parameters:
      file - File to Read
      Returns:
      StructureReader
    • getStructureReader

      StructureReader getStructureReader(@NotNull @NotNull InputStream stream)
      Fetches the current implementation of the StructureReader.
      Parameters:
      stream - InputStream to Read
      Returns:
      StructureReader
    • getStructureReader

      StructureReader getStructureReader(@NotNull @NotNull Reader reader)
      Fetches the current implementation of the StructureReader.
      Parameters:
      reader - Reader to Read
      Returns:
      StructureReader
    • getDisabledCosmetics

      @NotNull @NotNull @Unmodifiable Set<CosmeticLocation<?>> getDisabledCosmetics()
      Fetches an immutable set of all disabled cosmetics.
      Returns:
      Disabled Cosmetics
    • disableCosmetic

      void disableCosmetic(@NotNull @NotNull CosmeticLocation<?> loc)
      Disables a cosmetic.
      Parameters:
      loc - Cosmetic Location
    • disableCosmetic

      void disableCosmetic(@NotNull @NotNull Cosmetic c)
      Disables all cosmetics with the given Cosmetic Parent.
      Parameters:
      c - Cosmetic Parent
    • enableCosmetic

      void enableCosmetic(@NotNull @NotNull Cosmetic c)

      Enables all cosmetics with the parent. This method will silently fail if the cosmetic is not disabled.

      If any cosmetic locations are explicity disabled with this parent, they will be removed.

      Parameters:
      c - Cosmetic Parent
    • enableCosmetic

      void enableCosmetic(@NotNull @NotNull CosmeticLocation<?> loc)
      Enables a cosmetic. This method will silently fail if the cosmetic is not disabled.
      Parameters:
      loc - Cosmetic Location
    • 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

      double getRequirementMultiplier(@Nullable @Nullable CosmeticLocation<?> loc)
      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

      void setRequirementMultiplier(@Nullable @Nullable CosmeticLocation<?> loc, double multiplier)
      Sets the requirement multiplier for a specific cosmetic.
      Parameters:
      loc - Cosmetic Location
      multiplier - Requirement Multiplier
    • getBlacklistedPlayers

      @NotNull @NotNull List<OfflinePlayer> getBlacklistedPlayers()
      Fetches an immutable list of all of the players who cannot use cosmetics.
      Returns:
      Blacklisted Players
    • addBlacklistedPlayer

      default void addBlacklistedPlayer(@NotNull @NotNull OfflinePlayer player)
      Adds a player to the blacklist.
      Parameters:
      player - Player to add
    • removeBlacklistedPlayer

      default void removeBlacklistedPlayer(@Nullable @Nullable OfflinePlayer player)
      Removes a player from the blacklist.
      Parameters:
      player - Player to remove
    • isBlacklisted

      default boolean isBlacklisted(@Nullable @Nullable OfflinePlayer player)
      Whether a player is blacklisted.
      Parameters:
      player - Player to check
      Returns:
      true if blacklisted, else false
    • setBlacklistedPlayers

      void setBlacklistedPlayers(@NotNull @NotNull Iterable<? extends OfflinePlayer> players)
      Sets the list of blacklisted players.
      Parameters:
      players - Blacklisted Players
    • getBlacklistedSounds

      @NotNull @NotNull Set<Sound> getBlacklistedSounds()
      Fetches an immutable list of all of the sounds unavailable for use in Custom Sound Events.
      Returns:
      Blacklisted Sounds
    • addBlacklistedSound

      default void addBlacklistedSound(@NotNull @NotNull Sound sound)
      Adds a sound to the blacklist.
      Parameters:
      sound - Sound to add
    • removeBlacklistedSound

      default void removeBlacklistedSound(@Nullable @Nullable Sound sound)
      Removes a sound from the blacklist.
      Parameters:
      sound - Sound to remove
    • isBlacklisted

      default boolean isBlacklisted(@Nullable @Nullable Sound sound)
      Whether a sound is blacklisted.
      Parameters:
      sound - Sound to check
      Returns:
      true if blacklisted, else false
    • setBlacklistedSounds

      void setBlacklistedSounds(@NotNull @NotNull Iterable<Sound> sounds)
      Sets the list of blacklisted sounds.
      Parameters:
      sounds - Blacklisted Sounds
    • getCustomCosmetics

      @NotNull @NotNull Set<CosmeticLocation<?>> 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
    • getCustomStructures

      @NotNull @NotNull Set<Structure> getCustomStructures()
      Fetches all of the custom structures found in config.yml.
      Returns:
      Set of Custom Structures
    • isInPvP

      boolean isInPvP(@NotNull @NotNull Player p)
      Checks if the given player is currently in PvP.
      Parameters:
      p - Player to check
      Returns:
      true if in PvP, else false
    • getCanEmoteInPvP

      boolean getCanEmoteInPvP()
      Sets whether the given player is currently in PvP.
      Returns:
      true if in PvP, else false
    • setCanEmoteInPvP

      void setCanEmoteInPvP(boolean canEmoteInPvP)
      Sets whether the given player is currently in PvP.
      Parameters:
      canEmoteInPvP - true if in PvP, else false
    • getCanEmoteInPvE

      boolean getCanEmoteInPvE()
      Checks if the given player is currently in PvE.
      Returns:
      true if in PvE, else false
    • setCanEmoteInPvE

      void setCanEmoteInPvE(boolean canEmoteInPvE)
      Sets whether the given player is currently in PvE.
      Parameters:
      canEmoteInPvE - true if in PvE, else false