Class ConfigSpigot
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 Summary
ConstructorsConstructorDescriptionConfigSpigot(RestartableHolder restartableHolder, org.bukkit.plugin.java.JavaPlugin plugin, dagger.Lazy<StructureTypeManager> structureTypeManager, dagger.Lazy<ProtectionHookManagerSpigot> protectionHookManager, Path baseDir, DebuggableRegistry debuggableRegistry) Constructs a newConfigSpigot. -
Method Summary
Modifier and TypeMethodDescriptionintGets the amount of time (in minutes) power blocks should be kept in cache.booleanChecks if errors should be logged to the console.intcoolDown()Gets the number of ticks a structure should wait before it can be activated again.booleandebug()doubleGets the animation time multiplier for a specific type of structure.Gets the debug information for this object.org.bukkit.MaterialgetGuiMaterial(StructureType type) Set<org.bukkit.Material> Gets the set of materials that are blacklisted.getPrice(StructureType type) Gets the structure price formula for a specific type of structure.intGets the amount of time to keep heads cached.voidHandles the initialization.booleanbooleanbooleanbooleanlocale()logLevel()The log level to use.doubleGets the global maximum number of blocks a structure can move for applicable types (e.g. sliding door).Gets the global maximum distance (in blocks) a powerblock can be from the structure.Gets the global maximum number of structures a player can own.Gets the global maximum number of blocks that can be in a structure.Set<org.bukkit.Material> intGets the size of the thread pool used for redstone events.voidrewriteConfig(boolean printResults) Read the current config file and rewrite the file.voidshutDown()Handles a shutdown.booleanWhether to skip all animations by default.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.pim16aap2.animatedarchitecture.core.api.IConfig
specificationTimeout
-
Constructor Details
-
ConfigSpigot
@Inject public ConfigSpigot(RestartableHolder restartableHolder, org.bukkit.plugin.java.JavaPlugin plugin, dagger.Lazy<StructureTypeManager> structureTypeManager, dagger.Lazy<ProtectionHookManagerSpigot> protectionHookManager, @Named("pluginBaseDirectory") Path baseDir, DebuggableRegistry debuggableRegistry) Constructs a newConfigSpigot.- Parameters:
plugin- The Spigot core.
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:IRestartableHandles the initialization.- Specified by:
initializein interfaceIRestartable
-
shutDown
public void shutDown()Description copied from interface:IRestartableHandles a shutdown.- Specified by:
shutDownin interfaceIRestartable
-
rewriteConfig
public void rewriteConfig(boolean printResults) Read the current config file and rewrite the file. -
debug
public boolean debug() -
flagMovementFormula
- Specified by:
flagMovementFormulain interfaceIConfig- Returns:
- The movement formula of a flag.
-
coolDown
public int coolDown()Description copied from interface:IConfigGets the number of ticks a structure should wait before it can be activated again. -
locale
-
skipAnimationsByDefault
public boolean skipAnimationsByDefault()Description copied from interface:IConfigWhether 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:
skipAnimationsByDefaultin interfaceIConfig- Returns:
- True if all animations should be skipped by default.
-
maxStructureSize
Description copied from interface:IConfigGets the global maximum number of blocks that can be in a structure.Structures exceeding this limit cannot be created or activated.
- Specified by:
maxStructureSizein interfaceIConfig- Returns:
- The global maximum number of blocks that can be in a structure.
-
maxPowerBlockDistance
Description copied from interface:IConfigGets the global maximum distance (in blocks) a powerblock can be from the structure.- Specified by:
maxPowerBlockDistancein interfaceIConfig- Returns:
- The global maximum distance (in blocks) a powerblock can be from the structure.
-
cacheTimeout
public int cacheTimeout()Description copied from interface:IConfigGets the amount of time (in minutes) power blocks should be kept in cache.- Specified by:
cacheTimeoutin interfaceIConfig- Returns:
- The amount of time power blocks should be kept in cache.
-
isResourcePackEnabled
public boolean isResourcePackEnabled() -
resourcePack
-
maxStructureCount
Description copied from interface:IConfigGets the global maximum number of structures a player can own.- Specified by:
maxStructureCountin interfaceIConfig- Returns:
- The global maximum number of structures a player can own.
-
maxBlocksToMove
Description copied from interface:IConfigGets the global maximum number of blocks a structure can move for applicable types (e.g. sliding door).- Specified by:
maxBlocksToMovein interfaceIConfig- Returns:
- The global maximum number of blocks a structure can move for applicable types (e.g. sliding door).
-
isRedstoneEnabled
public boolean isRedstoneEnabled()- Specified by:
isRedstoneEnabledin interfaceIConfig- Returns:
- True if redstone is enabled.
-
loadChunksForToggle
public boolean loadChunksForToggle()- Specified by:
loadChunksForTogglein interfaceIConfig- Returns:
- True if we should try to load any unloaded chunks for a toggle.
-
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
Description copied from interface:IBlockAnalyzerConfigGets 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:
getMaterialBlacklistin interfaceIBlockAnalyzerConfig- Returns:
- The set of materials that are blacklisted.
-
getPrice
Description copied from interface:IConfigGets the structure price formula for a specific type of structure. -
getAnimationTimeMultiplier
Description copied from interface:IConfigGets the animation time multiplier for a specific type of structure.- Specified by:
getAnimationTimeMultiplierin interfaceIConfig- Parameters:
type- The structure type.- Returns:
- The animation time multiplier for the structure type.
-
getGuiMaterial
-
maxBlockSpeed
public double maxBlockSpeed()- Specified by:
maxBlockSpeedin interfaceIConfig- Returns:
- The global maximum speed of a block.
-
logLevel
Description copied from interface:IConfigThe log level to use. -
consoleLogging
public boolean consoleLogging()Description copied from interface:IConfigChecks if errors should be logged to the console.- Specified by:
consoleLoggingin interfaceIConfig- Returns:
- True if errors should be logged to the console.
-
getDebugInformation
Description copied from interface:IDebuggableGets the debug information for this object.- Specified by:
getDebugInformationin interfaceIDebuggable- Returns:
- The debug information or null if there's nothing to log at this time.
-
isHookEnabled
-
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
-