Package wtf.choco.veinminer.config
Interface VeinMinerConfiguration
- All Known Implementing Classes:
BukkitVeinMinerConfiguration
public interface VeinMinerConfiguration
Represents a rudimentary configuration for VeinMiner.
Note that any methods declared in this interface are pulled from a configuration file and
should not be confused with any similarly named methods that represent a stored state. For
instance, getDefaultActivationStrategy()
may not necessarily match the value
returned by VeinMinerServer.getDefaultActivationStrategy()
as the latter can be
changed by the server.
-
Method Summary
Modifier and TypeMethodDescriptionGet a set of all defined category ids.getCategoryBlockList
(@NotNull String categoryId) Get a list of block state strings for theBlockList
forVeinMinerToolCategory
with the given id.getCategoryItemList
(@NotNull String categoryId) Get a list of all item type strings for theVeinMinerToolCategory
with the given id.@NotNull ClientConfig
Get the defaultClientConfig
.double
getCost()
Get the amount of money to be pulled from a player's balance when vein mining.double
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.double
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.@NotNull ActivationStrategy
Get the defaultActivationStrategy
.@NotNull VeinMiningPattern
Get the defaultVeinMiningPattern
.Get a list of all disabled game modes.Get a list of all disabled worlds.getDisabledWorlds
(@NotNull String categoryId) Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.getDisabledWorlds
(@NotNull String categoryId, Supplier<Set<String>> defaultValues) Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.Get a list of block state strings for the globalBlockList
.float
Get the hunger modifier to be applied when a player vein mines.@Nullable String
Get the message to be sent to the player if they are too hungry to vein mine.@Nullable File
Get thedirectory
in which JSON files should be stored.int
Get the maximum amount of blocks that are allowed to be broken in a single vein mine.int
getMaxVeinSize
(@NotNull String categoryId) Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.int
getMaxVeinSize
(@NotNull String categoryId, int defaultValue) Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.int
Get the minimum food level required to vein mine.@Nullable String
Get the MySQL database name.@Nullable String
Get the MySQL host address.@Nullable String
Get the MySQL password.int
Get the MySQL port.@Nullable String
Get the prefix to use for all MySQL tables.@Nullable String
Get the MySQL username.@Nullable String
getNBTValue
(@NotNull String categoryId) Get the NBT value that must be on an item stack in order to use vein miner with theVeinMinerToolCategory
with the given id.int
getPriority
(@NotNull String categoryId) Get the numeric priority of theVeinMinerToolCategory
with the given id.Get a list of the strings defining block aliases.Get thestorage type
to use.boolean
Get whether or not vein miner is repair friendly and will ensure that tools do not break mid-vein mineboolean
isRepairFriendly
(@NotNull String categoryId) Get whether or not vein miner is repair friendly for theVeinMinerToolCategory
with the given id and will ensure that tools do not break mid-vein mine.boolean
isRepairFriendly
(@NotNull String categoryId, boolean defaultValue) Get whether or not vein miner is repair friendly for theVeinMinerToolCategory
with the given id and will ensure that tools do not break mid-vein mine.void
reload()
Reload all values from disk into memory.void
Save the default values of this configuration to disk.boolean
Get whether or not VeinMiner should check for updates using the update checker.boolean
Get whether or not dropped items should be collected at the block broken by the player that initiated the vein mine.void
updateBlockList
(@NotNull String categoryId, @NotNull BlockList blockList) Write to the configuration file to update the block list of the given category id with the providedBlockList
.void
updateToolList
(@NotNull VeinMinerToolCategory category) Write to the configuration file to update the item list of the given category.
-
Method Details
-
shouldCheckForUpdates
boolean shouldCheckForUpdates()Get whether or not VeinMiner should check for updates using the update checker.- Returns:
- true if should check for updates, false otherwise
-
getGlobalBlockList
Get a list of block state strings for the globalBlockList
.- Returns:
- the global block list
-
getCategoryBlockList
Get a list of block state strings for theBlockList
forVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- the block list of the given category
-
getDefaultActivationStrategy
Get the defaultActivationStrategy
.- Returns:
- the default activation strategy
-
getDefaultVeinMiningPattern
Get the defaultVeinMiningPattern
.- Returns:
- the default vein mining pattern
-
shouldCollectItemsAtSource
boolean shouldCollectItemsAtSource()Get whether or not dropped items should be collected at the block broken by the player that initiated the vein mine.- Returns:
- true if should collect at the source, false if dropped at the original positions
-
isRepairFriendly
boolean isRepairFriendly()Get whether or not vein miner is repair friendly and will ensure that tools do not break mid-vein mine- Returns:
- true if repair friendly, false otherwise
-
isRepairFriendly
Get whether or not vein miner is repair friendly for theVeinMinerToolCategory
with the given id and will ensure that tools do not break mid-vein mine.- Parameters:
categoryId
- the category id- Returns:
- true if the category is repair friendly, false otherwise
-
isRepairFriendly
Get whether or not vein miner is repair friendly for theVeinMinerToolCategory
with the given id and will ensure that tools do not break mid-vein mine.- Parameters:
categoryId
- the category iddefaultValue
- the default value to return if not explicitly set- Returns:
- true if the category is repair friendly, false otherwise
-
getMaxVeinSize
int getMaxVeinSize()Get the maximum amount of blocks that are allowed to be broken in a single vein mine.- Returns:
- the maximum vein size
-
getMaxVeinSize
Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- the maximum vein size of the category
-
getMaxVeinSize
Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category iddefaultValue
- the default value to return if not explicitly set- Returns:
- the maximum vein size of the category
-
getCost
double getCost()Get the amount of money to be pulled from a player's balance when vein mining.- Returns:
- the cost of a vein mine
-
getCost
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- the cost of a vein mine with the category
-
getCost
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category iddefaultValue
- the default value to return if not explicitly set- Returns:
- the cost of a vein mine with the category
-
getPriority
Get the numeric priority of theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- the priority
-
getNBTValue
Get the NBT value that must be on an item stack in order to use vein miner with theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- the required NBT value, or null if no value is required
-
getDisabledGameModeNames
Get a list of all disabled game modes.- Returns:
- all disabled game mode names
-
getDisabledWorlds
Get a list of all disabled worlds.- Returns:
- all disabled worlds
-
getDisabledWorlds
Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- all disabled worlds
-
getDisabledWorlds
@NotNull @NotNull Set<String> getDisabledWorlds(@NotNull @NotNull String categoryId, Supplier<Set<String>> defaultValues) Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category iddefaultValues
- the default values to return if not explicitly set- Returns:
- all disabled worlds
-
getHungerModifier
float getHungerModifier()Get the hunger modifier to be applied when a player vein mines. Higher values will apply more hunger to the player.- Returns:
- the hunger modifier
-
getMinimumFoodLevel
int getMinimumFoodLevel()Get the minimum food level required to vein mine.- Returns:
- the minimum food level
-
getHungryMessage
Get the message to be sent to the player if they are too hungry to vein mine.- Returns:
- the message to send, or null if none
-
getClientConfiguration
Get the defaultClientConfig
.- Returns:
- the default client config
-
getStorageType
Get thestorage type
to use.- Returns:
- the storage type
-
getJsonStorageDirectory
Get thedirectory
in which JSON files should be stored.- Returns:
- the json storage directory, or null if not specified
-
getMySQLHost
Get the MySQL host address.- Returns:
- the host address, or null if not specified
-
getMySQLPort
int getMySQLPort()Get the MySQL port.- Returns:
- the port, or 0 if not specified
-
getMySQLUsername
Get the MySQL username.- Returns:
- the username, or null if not specified
-
getMySQLPassword
Get the MySQL password.- Returns:
- the password, or null if not specified
-
getMySQLDatabase
Get the MySQL database name.- Returns:
- the database name, or null if not specified
-
getMySQLTablePrefix
Get the prefix to use for all MySQL tables.- Returns:
- the prefix, or null if not specified
-
getRawAliasStrings
Get a list of the strings defining block aliases.- Returns:
- the alias strings
-
getAllDefinedCategoryIds
Get a set of all defined category ids.- Returns:
- all category ids
-
getCategoryItemList
Get a list of all item type strings for theVeinMinerToolCategory
with the given id.- Parameters:
categoryId
- the category id- Returns:
- all items in the category
-
updateBlockList
Write to the configuration file to update the block list of the given category id with the providedBlockList
.- Parameters:
categoryId
- the category id to updateblockList
- the block list to set
-
updateToolList
Write to the configuration file to update the item list of the given category.- Parameters:
category
- the category to update
-
saveDefaults
void saveDefaults()Save the default values of this configuration to disk. -
reload
void reload()Reload all values from disk into memory.
-