java.lang.Object
nl.pim16aap2.animatedarchitecture.spigot.core.config.ConfigSpigot
All Implemented Interfaces:
IDebuggable, IConfig, IRestartable, IBlockAnalyzerConfig

@Singleton public final class ConfigSpigot extends Object implements IConfig, IDebuggable, IBlockAnalyzerConfig
Represents the configuration of the plugin for the Spigot platform.
  • Constructor Details

  • Method Details

    • initialize

      public void initialize()
      Description copied from interface: IRestartable
      Handles the initialization.
      Specified by:
      initialize in interface IRestartable
    • shutDown

      public void shutDown()
      Description copied from interface: IRestartable
      Handles a shutdown.
      Specified by:
      shutDown in interface IRestartable
    • rewriteConfig

      public void rewriteConfig(boolean printResults)
      Read the current config file and rewrite the file.
    • debug

      public boolean debug()
      Specified by:
      debug in interface IConfig
      Returns:
      True if debug mode is enabled.
    • flagMovementFormula

      public String flagMovementFormula()
      Specified by:
      flagMovementFormula in interface IConfig
      Returns:
      The movement formula of a flag.
    • coolDown

      public int coolDown()
      Description copied from interface: IConfig
      Gets the number of ticks a structure should wait before it can be activated again.
      Specified by:
      coolDown in interface IConfig
      Returns:
      The number of ticks a structure should wait before it can be activated again.
    • locale

      public Locale locale()
      Specified by:
      locale in interface IConfig
    • skipAnimationsByDefault

      public boolean skipAnimationsByDefault()
      Description copied from interface: IConfig
      Whether to skip all animations by default. If true, toggling a structure will simply teleport the blocks to their destination without any animations. For structures that don't have a destination, any toggle request will be ignored.
      Specified by:
      skipAnimationsByDefault in interface IConfig
      Returns:
      True if all animations should be skipped by default.
    • maxStructureSize

      public OptionalInt maxStructureSize()
      Description copied from interface: IConfig
      Gets the global maximum number of blocks that can be in a structure.

      Structures exceeding this limit cannot be created or activated.

      Specified by:
      maxStructureSize in interface IConfig
      Returns:
      The global maximum number of blocks that can be in a structure.
    • maxPowerBlockDistance

      public OptionalInt maxPowerBlockDistance()
      Description copied from interface: IConfig
      Gets the global maximum distance (in blocks) a powerblock can be from the structure.
      Specified by:
      maxPowerBlockDistance in interface IConfig
      Returns:
      The global maximum distance (in blocks) a powerblock can be from the structure.
    • cacheTimeout

      public int cacheTimeout()
      Description copied from interface: IConfig
      Gets the amount of time (in minutes) power blocks should be kept in cache.
      Specified by:
      cacheTimeout in interface IConfig
      Returns:
      The amount of time power blocks should be kept in cache.
    • isResourcePackEnabled

      public boolean isResourcePackEnabled()
    • resourcePack

      public String resourcePack()
    • maxStructureCount

      public OptionalInt maxStructureCount()
      Description copied from interface: IConfig
      Gets the global maximum number of structures a player can own.
      Specified by:
      maxStructureCount in interface IConfig
      Returns:
      The global maximum number of structures a player can own.
    • maxBlocksToMove

      public OptionalInt maxBlocksToMove()
      Description copied from interface: IConfig
      Gets the global maximum number of blocks a structure can move for applicable types (e.g. sliding door).
      Specified by:
      maxBlocksToMove in interface IConfig
      Returns:
      The global maximum number of blocks a structure can move for applicable types (e.g. sliding door).
    • isRedstoneEnabled

      public boolean isRedstoneEnabled()
      Specified by:
      isRedstoneEnabled in interface IConfig
      Returns:
      True if redstone is enabled.
    • loadChunksForToggle

      public boolean loadChunksForToggle()
      Specified by:
      loadChunksForToggle in interface IConfig
      Returns:
      True if we should try to load any unloaded chunks for a toggle.
    • powerBlockTypes

      public Set<org.bukkit.Material> powerBlockTypes()
    • headCacheTimeout

      public int headCacheTimeout()
      Gets the amount of time to keep heads cached.
      Returns:
      The amount of time (in minutes) to cache head items.
    • getMaterialBlacklist

      public Set<org.bukkit.Material> getMaterialBlacklist()
      Description copied from interface: IBlockAnalyzerConfig
      Gets the set of materials that are blacklisted.

      Materials in this set will not be allowed to be animated regardless of any other settings.

      Specified by:
      getMaterialBlacklist in interface IBlockAnalyzerConfig
      Returns:
      The set of materials that are blacklisted.
    • getPrice

      public String getPrice(StructureType type)
      Description copied from interface: IConfig
      Gets the structure price formula for a specific type of structure.
      Specified by:
      getPrice in interface IConfig
      Parameters:
      type - The structure type.
      Returns:
      The formula for the structure type.
    • getAnimationTimeMultiplier

      public double getAnimationTimeMultiplier(StructureType type)
      Description copied from interface: IConfig
      Gets the animation time multiplier for a specific type of structure.
      Specified by:
      getAnimationTimeMultiplier in interface IConfig
      Parameters:
      type - The structure type.
      Returns:
      The animation time multiplier for the structure type.
    • getGuiMaterial

      public org.bukkit.Material getGuiMaterial(StructureType type)
    • maxBlockSpeed

      public double maxBlockSpeed()
      Specified by:
      maxBlockSpeed in interface IConfig
      Returns:
      The global maximum speed of a block.
    • logLevel

      public Level logLevel()
      Description copied from interface: IConfig
      The log level to use.
      Specified by:
      logLevel in interface IConfig
      Returns:
      The log level.
    • consoleLogging

      public boolean consoleLogging()
      Description copied from interface: IConfig
      Checks if errors should be logged to the console.
      Specified by:
      consoleLogging in interface IConfig
      Returns:
      True if errors should be logged to the console.
    • getDebugInformation

      public String getDebugInformation()
      Description copied from interface: IDebuggable
      Gets the debug information for this object.
      Specified by:
      getDebugInformation in interface IDebuggable
      Returns:
      The debug information or null if there's nothing to log at this time.
    • isHookEnabled

      public boolean isHookEnabled(IProtectionHookSpigotSpecification spec)
    • getCommandAliases

      public List<String> getCommandAliases()
    • redstoneThreadPoolSize

      public int redstoneThreadPoolSize()
      Gets the size of the thread pool used for redstone events.
      Returns:
      The size of the thread pool used for redstone events.
    • toString

      public String toString()
      Overrides:
      toString in class Object