Package wtf.choco.veinminer.config
Class BukkitVeinMinerConfiguration
java.lang.Object
wtf.choco.veinminer.config.BukkitVeinMinerConfiguration
- All Implemented Interfaces:
VeinMinerConfiguration
Bukkit implementation of
VeinMinerConfiguration
.-
Constructor Summary
ConstructorDescriptionBukkitVeinMinerConfiguration
(@NotNull VeinMinerPlugin plugin) Construct a newBukkitVeinMinerConfiguration
. -
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.@NotNull PersistentDataStorage.Type
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.
-
Constructor Details
-
BukkitVeinMinerConfiguration
Construct a newBukkitVeinMinerConfiguration
.- Parameters:
plugin
- the plugin instance
-
-
Method Details
-
shouldCheckForUpdates
public boolean shouldCheckForUpdates()Description copied from interface:VeinMinerConfiguration
Get whether or not VeinMiner should check for updates using the update checker.- Specified by:
shouldCheckForUpdates
in interfaceVeinMinerConfiguration
- Returns:
- true if should check for updates, false otherwise
-
getGlobalBlockList
Description copied from interface:VeinMinerConfiguration
Get a list of block state strings for the globalBlockList
.- Specified by:
getGlobalBlockList
in interfaceVeinMinerConfiguration
- Returns:
- the global block list
-
getCategoryBlockList
Description copied from interface:VeinMinerConfiguration
Get a list of block state strings for theBlockList
forVeinMinerToolCategory
with the given id.- Specified by:
getCategoryBlockList
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- the block list of the given category
-
getDefaultActivationStrategy
Description copied from interface:VeinMinerConfiguration
Get the defaultActivationStrategy
.- Specified by:
getDefaultActivationStrategy
in interfaceVeinMinerConfiguration
- Returns:
- the default activation strategy
-
getDefaultVeinMiningPattern
Description copied from interface:VeinMinerConfiguration
Get the defaultVeinMiningPattern
.- Specified by:
getDefaultVeinMiningPattern
in interfaceVeinMinerConfiguration
- Returns:
- the default vein mining pattern
-
shouldCollectItemsAtSource
public boolean shouldCollectItemsAtSource()Description copied from interface:VeinMinerConfiguration
Get whether or not dropped items should be collected at the block broken by the player that initiated the vein mine.- Specified by:
shouldCollectItemsAtSource
in interfaceVeinMinerConfiguration
- Returns:
- true if should collect at the source, false if dropped at the original positions
-
isRepairFriendly
public boolean isRepairFriendly()Description copied from interface:VeinMinerConfiguration
Get whether or not vein miner is repair friendly and will ensure that tools do not break mid-vein mine- Specified by:
isRepairFriendly
in interfaceVeinMinerConfiguration
- Returns:
- true if repair friendly, false otherwise
-
isRepairFriendly
Description copied from interface:VeinMinerConfiguration
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.- Specified by:
isRepairFriendly
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- true if the category is repair friendly, false otherwise
-
isRepairFriendly
Description copied from interface:VeinMinerConfiguration
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.- Specified by:
isRepairFriendly
in interfaceVeinMinerConfiguration
- 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
public int getMaxVeinSize()Description copied from interface:VeinMinerConfiguration
Get the maximum amount of blocks that are allowed to be broken in a single vein mine.- Specified by:
getMaxVeinSize
in interfaceVeinMinerConfiguration
- Returns:
- the maximum vein size
-
getMaxVeinSize
Description copied from interface:VeinMinerConfiguration
Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.- Specified by:
getMaxVeinSize
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- the maximum vein size of the category
-
getMaxVeinSize
Description copied from interface:VeinMinerConfiguration
Get the maximum amount of blocks that are allowed to be broken in a single vein mine by theVeinMinerToolCategory
with the given id.- Specified by:
getMaxVeinSize
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category iddefaultValue
- the default value to return if not explicitly set- Returns:
- the maximum vein size of the category
-
getCost
public double getCost()Description copied from interface:VeinMinerConfiguration
Get the amount of money to be pulled from a player's balance when vein mining.- Specified by:
getCost
in interfaceVeinMinerConfiguration
- Returns:
- the cost of a vein mine
-
getCost
Description copied from interface:VeinMinerConfiguration
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.- Specified by:
getCost
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- the cost of a vein mine with the category
-
getCost
Description copied from interface:VeinMinerConfiguration
Get the amount of money to be pulled from a player's balance when vein mining with theVeinMinerToolCategory
with the given id.- Specified by:
getCost
in interfaceVeinMinerConfiguration
- 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
Description copied from interface:VeinMinerConfiguration
Get the numeric priority of theVeinMinerToolCategory
with the given id.- Specified by:
getPriority
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- the priority
-
getNBTValue
Description copied from interface:VeinMinerConfiguration
Get the NBT value that must be on an item stack in order to use vein miner with theVeinMinerToolCategory
with the given id.- Specified by:
getNBTValue
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- the required NBT value, or null if no value is required
-
getDisabledGameModeNames
Description copied from interface:VeinMinerConfiguration
Get a list of all disabled game modes.- Specified by:
getDisabledGameModeNames
in interfaceVeinMinerConfiguration
- Returns:
- all disabled game mode names
-
getDisabledWorlds
Description copied from interface:VeinMinerConfiguration
Get a list of all disabled worlds.- Specified by:
getDisabledWorlds
in interfaceVeinMinerConfiguration
- Returns:
- all disabled worlds
-
getDisabledWorlds
Description copied from interface:VeinMinerConfiguration
Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.- Specified by:
getDisabledWorlds
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- all disabled worlds
-
getDisabledWorlds
@NotNull public @NotNull Set<String> getDisabledWorlds(@NotNull @NotNull String categoryId, Supplier<Set<String>> defaultValues) Description copied from interface:VeinMinerConfiguration
Get a list of all disabled worlds for theVeinMinerToolCategory
with the given id.- Specified by:
getDisabledWorlds
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category iddefaultValues
- the default values to return if not explicitly set- Returns:
- all disabled worlds
-
getHungerModifier
public float getHungerModifier()Description copied from interface:VeinMinerConfiguration
Get the hunger modifier to be applied when a player vein mines. Higher values will apply more hunger to the player.- Specified by:
getHungerModifier
in interfaceVeinMinerConfiguration
- Returns:
- the hunger modifier
-
getMinimumFoodLevel
public int getMinimumFoodLevel()Description copied from interface:VeinMinerConfiguration
Get the minimum food level required to vein mine.- Specified by:
getMinimumFoodLevel
in interfaceVeinMinerConfiguration
- Returns:
- the minimum food level
-
getHungryMessage
Description copied from interface:VeinMinerConfiguration
Get the message to be sent to the player if they are too hungry to vein mine.- Specified by:
getHungryMessage
in interfaceVeinMinerConfiguration
- Returns:
- the message to send, or null if none
-
getClientConfiguration
Description copied from interface:VeinMinerConfiguration
Get the defaultClientConfig
.- Specified by:
getClientConfiguration
in interfaceVeinMinerConfiguration
- Returns:
- the default client config
-
getStorageType
Description copied from interface:VeinMinerConfiguration
Get thestorage type
to use.- Specified by:
getStorageType
in interfaceVeinMinerConfiguration
- Returns:
- the storage type
-
getJsonStorageDirectory
Description copied from interface:VeinMinerConfiguration
Get thedirectory
in which JSON files should be stored.- Specified by:
getJsonStorageDirectory
in interfaceVeinMinerConfiguration
- Returns:
- the json storage directory, or null if not specified
-
getMySQLHost
Description copied from interface:VeinMinerConfiguration
Get the MySQL host address.- Specified by:
getMySQLHost
in interfaceVeinMinerConfiguration
- Returns:
- the host address, or null if not specified
-
getMySQLPort
public int getMySQLPort()Description copied from interface:VeinMinerConfiguration
Get the MySQL port.- Specified by:
getMySQLPort
in interfaceVeinMinerConfiguration
- Returns:
- the port, or 0 if not specified
-
getMySQLUsername
Description copied from interface:VeinMinerConfiguration
Get the MySQL username.- Specified by:
getMySQLUsername
in interfaceVeinMinerConfiguration
- Returns:
- the username, or null if not specified
-
getMySQLPassword
Description copied from interface:VeinMinerConfiguration
Get the MySQL password.- Specified by:
getMySQLPassword
in interfaceVeinMinerConfiguration
- Returns:
- the password, or null if not specified
-
getMySQLDatabase
Description copied from interface:VeinMinerConfiguration
Get the MySQL database name.- Specified by:
getMySQLDatabase
in interfaceVeinMinerConfiguration
- Returns:
- the database name, or null if not specified
-
getMySQLTablePrefix
Description copied from interface:VeinMinerConfiguration
Get the prefix to use for all MySQL tables.- Specified by:
getMySQLTablePrefix
in interfaceVeinMinerConfiguration
- Returns:
- the prefix, or null if not specified
-
getRawAliasStrings
Description copied from interface:VeinMinerConfiguration
Get a list of the strings defining block aliases.- Specified by:
getRawAliasStrings
in interfaceVeinMinerConfiguration
- Returns:
- the alias strings
-
getAllDefinedCategoryIds
Description copied from interface:VeinMinerConfiguration
Get a set of all defined category ids.- Specified by:
getAllDefinedCategoryIds
in interfaceVeinMinerConfiguration
- Returns:
- all category ids
-
getCategoryItemList
Description copied from interface:VeinMinerConfiguration
Get a list of all item type strings for theVeinMinerToolCategory
with the given id.- Specified by:
getCategoryItemList
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id- Returns:
- all items in the category
-
updateBlockList
public void updateBlockList(@NotNull @NotNull String categoryId, @NotNull @NotNull BlockList blockList) Description copied from interface:VeinMinerConfiguration
Write to the configuration file to update the block list of the given category id with the providedBlockList
.- Specified by:
updateBlockList
in interfaceVeinMinerConfiguration
- Parameters:
categoryId
- the category id to updateblockList
- the block list to set
-
updateToolList
Description copied from interface:VeinMinerConfiguration
Write to the configuration file to update the item list of the given category.- Specified by:
updateToolList
in interfaceVeinMinerConfiguration
- Parameters:
category
- the category to update
-
saveDefaults
public void saveDefaults()Description copied from interface:VeinMinerConfiguration
Save the default values of this configuration to disk.- Specified by:
saveDefaults
in interfaceVeinMinerConfiguration
-
reload
public void reload()Description copied from interface:VeinMinerConfiguration
Reload all values from disk into memory.- Specified by:
reload
in interfaceVeinMinerConfiguration
-