Class Settings

java.lang.Object
ua.mcchickenstudio.opencreative.settings.Settings

public final class Settings extends Object

Settings

This class represents Settings, that stores values which are used in plugin.
  • Constructor Details

    • Settings

      public Settings()
  • Method Details

    • load

      public void load(boolean reload)
      Loads settings values from configuration file.
    • isWorldGenerationUnavailable

      public boolean isWorldGenerationUnavailable()
    • setSoundsTheme

      public boolean setSoundsTheme(String theme)
    • addRecommendedWorld

      public boolean addRecommendedWorld(int worldID)
    • removeRecommendedWorld

      public boolean removeRecommendedWorld(int worldID)
    • addMessageIgnoringReset

      public boolean addMessageIgnoringReset(@NotNull @NotNull String path)
    • removeMessageIgnoringReset

      public boolean removeMessageIgnoringReset(@NotNull @NotNull String path)
    • setCustomItem

      public void setCustomItem(ItemsGroup group, int slot, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
    • setCustomItem

      public void setCustomItem(ItemsGroup group, int slot, @NotNull @NotNull Items item)
    • resetItemsGroup

      public void resetItemsGroup(ItemsGroup group)
    • isDebug

      public boolean isDebug()
    • setDebug

      public void setDebug(boolean debug)
    • isMaintenance

      public boolean isMaintenance()
      Checks whether it's maintenance mode or not.
      Returns:
      true - enabled, false - disabled.
    • setMaintenance

      public void setMaintenance(boolean maintenance)
      Sets maintenance mode without command sender.

      If maintenance mode is same as specified, nothing will be changed.

      If true - will unload all worlds and teleport players to lobby, and then prevent them from browsing and connecting to worlds.

      If false - will allow players to visit their worlds.

      Parameters:
      maintenance - true - enabled, false - disabled.
    • setMaintenance

      public void setMaintenance(boolean maintenance, @Nullable @Nullable org.bukkit.command.CommandSender sender)
      Sets maintenance mode.

      If maintenance mode is same as specified, nothing will be changed.

      If true - will unload all worlds and teleport players to lobby, and then prevent them from browsing and connecting to worlds.

      If false - will allow players to visit their worlds.

      Parameters:
      maintenance - true - enabled, false - disabled.
      sender - sender, who set maintenance mode.
    • getAllowedResourcePackLinks

      public Set<String> getAllowedResourcePackLinks()
    • getRecommendedWorldsIDs

      public Set<Integer> getRecommendedWorldsIDs()
    • isCreativeChatEnabled

      public boolean isCreativeChatEnabled()
    • setCreativeChatEnabled

      public void setCreativeChatEnabled(boolean creativeChatEnabled)
    • getListChanger

      public Settings.PlayerListChanger getListChanger()
    • getGroups

      @NotNull public @NotNull Groups getGroups()
      Returns instance of groups, that stores all groups and contains methods to get data from them.
      Returns:
      groups instance.
    • getItemFixerSettings

      @NotNull public @NotNull ItemFixerSettings getItemFixerSettings()
      Returns settings of item fixer.
      Returns:
      item fixer settings.
    • getWorldFixerSettings

      @NotNull public @NotNull WorldFixerSettings getWorldFixerSettings()
      Returns settings of world fixer.
      Returns:
      world fixer settings.
    • getCodingSettings

      @NotNull public @NotNull CodingSettings getCodingSettings()
      Returns settings of coding mode.
      Returns:
      coding settings.
    • getRequirements

      @NotNull public @NotNull Requirements getRequirements()
      Returns settings of requirements.
      Returns:
      requirements settings.
    • getLobbySettings

      @NotNull public @NotNull LobbySettings getLobbySettings()
      Returns settings of lobby world.
      Returns:
      lobby settings.
    • getWebSettings

      @NotNull public @NotNull WebSettings getWebSettings()
      Returns settings of web services.
      Returns:
      web settings.
    • getDownloaderSettings

      @NotNull public @NotNull DownloaderSettings getDownloaderSettings()
      Returns settings of world downloader.
      Returns:
      world downloader settings.
    • getEconomySettings

      @NotNull public @NotNull EconomySettings getEconomySettings()
      Returns settings of economy.
      Returns:
      economy settings.
    • getCommands

      @NotNull public @NotNull Commands getCommands()
      Returns custom commands executions.
      Returns:
      commands events.
    • shouldLogCriticalErrors

      public boolean shouldLogCriticalErrors()
      Checks whether critical errors will be shown in console.
      Returns:
      true - will be shown, false - hidden.
    • shouldLogGriefStats

      public boolean shouldLogGriefStats()
      Checks whether grief stats will be shown in console.
      Returns:
      true - will be shown, false - hidden.
    • shouldLogSignEdits

      public boolean shouldLogSignEdits()
      Checks whether sign edits will be shown in console.
      Returns:
      true - will be shown, false - hidden.
    • shouldLogWarnings

      public boolean shouldLogWarnings()
      Checks whether warnings will be shown in console.
      Returns:
      true - will be shown, false - hidden.
    • shouldLogNotFoundMessages

      public boolean shouldLogNotFoundMessages()
      Checks whether not translated messages will be shown in console.
      Returns:
      true - will be shown, false - hidden.
    • shouldCancelChatOnConfirmation

      public boolean shouldCancelChatOnConfirmation()
      Checks whether player's messages should be hidden from chat, when they're changing world's or module's name or description.
      Returns:
      true - will be hidden, false - shown.
    • shouldHandleWorldChat

      public boolean shouldHandleWorldChat()
      Checks whether world chat and messages starting with ! will be handled by OpenCreative+.
      Returns:
      true - will be handled, false - ignored, other plugins will be responsible.
    • getSounds

      public Map<Sounds, SettingsSound> getSounds()
      Returns a map of sounds and custom sounds from config.
      Returns:
      map of sounds.
    • getItemsGroups

      public Map<ItemsGroup, SettingsItemsGroup> getItemsGroups()
      Returns a map of item groups and custom item groups from config.
      Returns:
      map of item groups.
    • shouldNotifyAboutNoPlayersAround

      public boolean shouldNotifyAboutNoPlayersAround()
      Checks whether player should see "No players around message" message, when there is no other players in their world.
      Returns:
      true - will be shown, false - will be hidden.
    • getMessagesIgnoringReset

      public Set<String> getMessagesIgnoringReset()
      Returns set of messages paths, that will be recovered on resetting locale from old localization file to new.
      Returns:
      set of messages paths, that should be saved.
    • shouldGenerateFlatWorldHigher

      public boolean shouldGenerateFlatWorldHigher()
      Checks whether flat world generator should generate a world starting with Y: 0, instead of Y: -64.
      Returns:
      true - will generate higher (old versions), false - lower (newer).
    • isFirstLaunch

      public boolean isFirstLaunch()
      Checks whether plugin was launched for first time, without /plugins/OpenCreative folder.
      Returns:
      true - first time launched, false - was launched on server before.