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 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

      @NotNull @NotNull List<String> getGlobalBlockList()
      Get a list of block state strings for the global BlockList.
      Returns:
      the global block list
    • getCategoryBlockList

      @NotNull @NotNull List<String> getCategoryBlockList(@NotNull @NotNull String categoryId)
      Get a list of block state strings for the BlockList for VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      the block list of the given category
    • getDefaultActivationStrategy

      @NotNull @NotNull ActivationStrategy getDefaultActivationStrategy()
      Get the default ActivationStrategy.
      Returns:
      the default activation strategy
    • getDefaultVeinMiningPattern

      @NotNull @NotNull VeinMiningPattern getDefaultVeinMiningPattern()
      Get the default VeinMiningPattern.
      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

      boolean isRepairFriendly(@NotNull @NotNull String categoryId)
      Get whether or not vein miner is repair friendly for the VeinMinerToolCategory 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

      boolean isRepairFriendly(@NotNull @NotNull String categoryId, boolean defaultValue)
      Get whether or not vein miner is repair friendly for the VeinMinerToolCategory with the given id and will ensure that tools do not break mid-vein mine.
      Parameters:
      categoryId - the category id
      defaultValue - 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

      int getMaxVeinSize(@NotNull @NotNull String categoryId)
      Get the maximum amount of blocks that are allowed to be broken in a single vein mine by the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      the maximum vein size of the category
    • getMaxVeinSize

      int getMaxVeinSize(@NotNull @NotNull String categoryId, int defaultValue)
      Get the maximum amount of blocks that are allowed to be broken in a single vein mine by the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      defaultValue - 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

      double getCost(@NotNull @NotNull String categoryId)
      Get the amount of money to be pulled from a player's balance when vein mining with the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      the cost of a vein mine with the category
    • getCost

      double getCost(@NotNull @NotNull String categoryId, double defaultValue)
      Get the amount of money to be pulled from a player's balance when vein mining with the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      defaultValue - the default value to return if not explicitly set
      Returns:
      the cost of a vein mine with the category
    • getPriority

      int getPriority(@NotNull @NotNull String categoryId)
      Get the numeric priority of the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      the priority
    • getNBTValue

      @Nullable @Nullable String getNBTValue(@NotNull @NotNull String categoryId)
      Get the NBT value that must be on an item stack in order to use vein miner with the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      the required NBT value, or null if no value is required
    • getDisabledGameModeNames

      @NotNull @NotNull List<String> getDisabledGameModeNames()
      Get a list of all disabled game modes.
      Returns:
      all disabled game mode names
    • getDisabledWorlds

      @NotNull @NotNull Set<String> getDisabledWorlds()
      Get a list of all disabled worlds.
      Returns:
      all disabled worlds
    • getDisabledWorlds

      @NotNull @NotNull Set<String> getDisabledWorlds(@NotNull @NotNull String categoryId)
      Get a list of all disabled worlds for the VeinMinerToolCategory 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 the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      defaultValues - 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

      @Nullable @Nullable String 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

      @NotNull @NotNull ClientConfig getClientConfiguration()
      Get the default ClientConfig.
      Returns:
      the default client config
    • getStorageType

      @NotNull PersistentDataStorage.Type getStorageType()
      Get the storage type to use.
      Returns:
      the storage type
    • getJsonStorageDirectory

      @Nullable @Nullable File getJsonStorageDirectory()
      Get the directory in which JSON files should be stored.
      Returns:
      the json storage directory, or null if not specified
    • getMySQLHost

      @Nullable @Nullable String 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

      @Nullable @Nullable String getMySQLUsername()
      Get the MySQL username.
      Returns:
      the username, or null if not specified
    • getMySQLPassword

      @Nullable @Nullable String getMySQLPassword()
      Get the MySQL password.
      Returns:
      the password, or null if not specified
    • getMySQLDatabase

      @Nullable @Nullable String getMySQLDatabase()
      Get the MySQL database name.
      Returns:
      the database name, or null if not specified
    • getMySQLTablePrefix

      @Nullable @Nullable String getMySQLTablePrefix()
      Get the prefix to use for all MySQL tables.
      Returns:
      the prefix, or null if not specified
    • getRawAliasStrings

      @NotNull @NotNull List<String> getRawAliasStrings()
      Get a list of the strings defining block aliases.
      Returns:
      the alias strings
    • getAllDefinedCategoryIds

      @NotNull @NotNull Set<String> getAllDefinedCategoryIds()
      Get a set of all defined category ids.
      Returns:
      all category ids
    • getCategoryItemList

      @NotNull @NotNull List<String> getCategoryItemList(@NotNull @NotNull String categoryId)
      Get a list of all item type strings for the VeinMinerToolCategory with the given id.
      Parameters:
      categoryId - the category id
      Returns:
      all items in the category
    • updateBlockList

      void updateBlockList(@NotNull @NotNull String categoryId, @NotNull @NotNull BlockList blockList)
      Write to the configuration file to update the block list of the given category id with the provided BlockList.
      Parameters:
      categoryId - the category id to update
      blockList - the block list to set
    • updateToolList

      void updateToolList(@NotNull @NotNull VeinMinerToolCategory category)
      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.