Interface NovaConfig


public interface NovaConfig
Configuration used for API
  • Method Details

    • getConfiguration

      static NovaConfig getConfiguration()
      Fetches this Configuration.
      Returns:
      this configuration
    • getMarket

      static NovaMarket getMarket()
      Fetches the Novaconomy Market.
      Returns:
      Novaconomy Market
    • getConfigFile

      static File getConfigFile()
      Fetches the file of the main config.yml.
      Returns:
      Configuration File
    • getBusinessesFolder

      @NotNull static @NotNull File getBusinessesFolder()
      Fetches the folder that all Businesses are stored.
      Returns:
      Businesses Folder
      Since:
      1.6.0
    • getCorporationsFolder

      @NotNull static @NotNull File getCorporationsFolder()
      Fetches the folder that all Corporations are stored in.
      Returns:
      Corporations Folder
      Since:
      1.7.0
    • print

      static void print(@NotNull @NotNull Throwable t)
      Prints a Throwable in the Plugin's Namespace and Format.
      Parameters:
      t - Throwable to print
      Since:
      1.6.0
    • hasNotifications

      boolean hasNotifications()
      Whether Notifications is turned on inside of the configuration.
      Returns:
      true if notifications, else false
    • getInterestTicks

      long getInterestTicks()
      Fetch how often Interest is Applied.
      Returns:
      how often interest is applied, in ticks
    • getPlugin

      static Plugin getPlugin()
      Fetches the plugin instance.
      Returns:
      Plugin Instance
    • getPlayerDirectory

      static File getPlayerDirectory()
      Fetch the Player Directory
      Returns:
      Player Directory
    • getDataFolder

      static File getDataFolder()
      Fetches the Data Folder of this Plugin.
      Returns:
      Data Folder
    • getEconomiesConfig

      @Deprecated static FileConfiguration getEconomiesConfig()
      Deprecated.
      Economies are no longer stored in a single file
      Fetch the Economies File
      Returns:
      Economies File
    • getEconomiesFile

      @Deprecated static File getEconomiesFile()
      Deprecated.
      Economies are no longer stored in a single file
      Fetches the File related to ecnomies.yml.
      Returns:
      File related to economies.yml
    • getEconomiesFolder

      static File getEconomiesFolder()
      Fetches the folder that all Economies are stored in.
      Returns:
      Economies Folder
    • reloadRunnables

      static void reloadRunnables()
      Reloads the Interest and Taxes Runnables with new values from the configuration.
    • getBusinessFile

      @Deprecated static File getBusinessFile()
      Deprecated.
      Businesses are now stored in individual files
      Fetches the File that businesses.yml belongs to.
      Returns:
      businesses.yml File
    • getLogger

      static Logger getLogger()
      Fetches the Plugin's Logger.
      Returns:
      Plugin Logger
    • loadBusinesses

      @Deprecated static FileConfiguration loadBusinesses()
      Deprecated.
      Businesses are now stored in individual files
      Loads the businesses.yml file.
      Returns:
      Businesses File
    • getFunctionalityFile

      @NotNull static @NotNull File getFunctionalityFile()
      Fetches the Functionality Configuration File.
      Returns:
      Functionality File
    • getFunctionalityConfig

      @NotNull static @NotNull FileConfiguration getFunctionalityConfig()
      Fetches the functionality.yml Configuration.
      Returns:
      Functionality Configuration
    • loadFunctionalityFile

      @NotNull static @NotNull FileConfiguration loadFunctionalityFile()
      Loads the Functionality Configuration.
      Returns:
      Loaded Functionality Configuration
    • getGlobalStorage

      @Nullable static @Nullable FileConfiguration getGlobalStorage()
      Fetches the global storage configuration.
      Returns:
      Global Storage Configuration, or null if file doesn't exist
    • getGlobalFile

      @NotNull static @NotNull File getGlobalFile()
      Fetches the file instance of the Global Storage.
      Returns:
      Global Storage File Instance
    • getConfig

      @NotNull static @NotNull FileConfiguration getConfig()
      Fetches the Configuration without checking its values.
      Returns:
      Unchecked FileConfiguration
    • loadConfig

      @NotNull static @NotNull FileConfiguration loadConfig()
      Loads the configuration's values.
      Returns:
      Loaded FileConfiguration
    • getLanguage

      String getLanguage()
      Fetches the current language set.
      Returns:
      Langauge set
    • isInterestEnabled

      boolean isInterestEnabled()
      Fetch if Interest is Enabled
      Returns:
      true if enabled, else false
    • hasMiningIncrease

      boolean hasMiningIncrease()
      Fetch if Mining Increase is enabled.
      Returns:
      true if enabled, else false
    • hasFishingIncrease

      boolean hasFishingIncrease()
      Fetch if Fishing Increase is enabled.
      Returns:
      true if enabled, else false
    • hasKillIncrease

      boolean hasKillIncrease()
      Fetch if Killing Increase is enabled.
      Returns:
      true if enabled, else false
    • hasIndirectKillIncrease

      boolean hasIndirectKillIncrease()
      Fetch if Indirect Killing (projectiles, pets) counts towards a Kill Increase.
      Returns:
      true if enabled, else false
    • hasDeathDecrease

      boolean hasDeathDecrease()
      Fetch if Death Decrease is enabled.
      Returns:
      true if enabled, else false
    • hasFarmingIncrease

      boolean hasFarmingIncrease()
      Fetch is Farming Increase is enabled.
      Returns:
      true if enabled, else false
    • getInterestMultiplier

      double getInterestMultiplier()
      Fetch the Interest Multiplier
      Returns:
      Multiplier applied when using interest
    • setInterestMultiplier

      void setInterestMultiplier(double multiplier)
      Sets the interest multiplier
      Parameters:
      multiplier - New Interest Multiplier
    • getMiningChance

      int getMiningChance()
      Fetch the mining chance of increase
      Returns:
      Chance of mining increase
    • getFishingChance

      int getFishingChance()
      Fetch the fishing chance of increase
      Returns:
      Chance of fishing increase
    • getKillChance

      int getKillChance()
      Fetch the killing chance of increase
      Returns:
      Chance of killing increase
    • getFarmingChance

      int getFarmingChance()
      Fetch the farming chance of increase
      Returns:
      Chance of farming increase
    • setKillChance

      void setKillChance(int chance)
      Sets the chance of killing something increasing your money.
      Parameters:
      chance - New Chance
    • setFishingChance

      void setFishingChance(int chance)
      Sets the chance of successfully fishing something to increase your money.
      Parameters:
      chance - New Chance
    • setMiningChance

      void setMiningChance(int chance)
      Sets the chacne of mining something to increase your money.
      Parameters:
      chance - New Chance
    • setFarmingChance

      void setFarmingChance(int chance)
      Sets the chance of farming something to increase your money.
      Parameters:
      chance - New Chance
    • setFarmingIncrease

      void setFarmingIncrease(boolean increase)
      Sets whether or not farming should increase money.
      Parameters:
      increase - Whether farming should increase money
    • setMiningIncrease

      void setMiningIncrease(boolean increase)
      Sets whether or not mining should increase money.
      Parameters:
      increase - Whether mining should increase money
    • setKillIncrease

      void setKillIncrease(boolean increase)
      Sets whether or not killing something should increase money.
      Parameters:
      increase - Whether killing something should increase money
    • setDeathDecrease

      void setDeathDecrease(boolean decrease)
      Sets whether or not dying should decrease money.
      Parameters:
      decrease - Whether dying should decrease money
    • getDeathDivider

      double getDeathDivider()
      Fetches the Divider used when removing money in a DeathDecrease.
      Returns:
      Divider Used
      See Also:
    • setDeathDivider

      void setDeathDivider(double divider)
      Sets the divider of the Death Event.

      When a Player dies, the plugin will remove the balance divided by this value.

      Parameters:
      divider - Divider to use
    • setInterestEnabled

      void setInterestEnabled(boolean enabled)
      Sets whether or not interest is enabled.
      Parameters:
      enabled - true if enabled, else false
    • getMaxConvertAmount

      double getMaxConvertAmount(Economy econ)
      Fetches the maximum amount of money a player can convert FROM.

      This value does not control how much money a player will receive after converting.
      Parameters:
      econ - Economy to test against
      Returns:
      Maximum amount
    • reloadHooks

      void reloadHooks()
      Reloads API Hooks (Placeholders, Vault, etc.).
    • getMaxWithdrawAmount

      double getMaxWithdrawAmount(Economy econ)
      Fetches the maxmimum amount of money a player can withdraw from the global bank on a daily basis.
      Parameters:
      econ - Economy to test against
      Returns:
      Maximum amount
    • canBypassWithdraw

      boolean canBypassWithdraw(OfflinePlayer p)
      Whether this OfflinePlayer can bypass the max withdraw amount.
      Parameters:
      p - Player to test against
      Returns:
      true if they can, else false
    • canBypassWithdraw

      default boolean canBypassWithdraw(NovaPlayer np)
      Whether this NovaPlayer can bypass the max withdraw amount.
      Parameters:
      np - NovaPlayer to test against
      Returns:
      true if they can, else false
    • canIgnoreTaxes

      boolean canIgnoreTaxes(OfflinePlayer p)
      Whether this OfflinePlayer does not automatically pay taxes.
      Parameters:
      p - Player to test against
      Returns:
      true if they can, else false
    • canIgnoreTaxes

      default boolean canIgnoreTaxes(NovaPlayer np)
      Whether this NovaPlayer does not automatically pay taxes.
      Parameters:
      np - NovaPlayer to test against
      Returns:
      true if they can, else false
    • hasAutomaticTaxes

      boolean hasAutomaticTaxes()
      Whether automatic tax payments are enabled.
      Returns:
      true if enabled, else false
    • getTaxesTicks

      long getTaxesTicks()
      Fetches how often, in ticks, taxes should be automatically withdrawed from the player's balance.
      Returns:
      Withdraw interval
    • getMinimumPayment

      double getMinimumPayment(Economy econ)
      Fetches the Minimum amount of money a player must be taxed.
      Parameters:
      econ - Economy to test against
      Returns:
      Minimum amount
    • hasOnlineTaxes

      boolean hasOnlineTaxes()
      Whether Players have to be online for taxes to be paid.
      Returns:
      true if they must be online, else false
    • setOnlineTaxes

      void setOnlineTaxes(boolean enabled)
      Sets whether Players have to be online for taxes to be paid.
      Parameters:
      enabled - true if they must be online, else false
    • hasCustomTaxes

      boolean hasCustomTaxes()
      Whether custom tax events are enabled.
      Returns:
      true if enabled, else false
    • setCustomTaxes

      void setCustomTaxes(boolean enabled)
      Sets whether custom tax events are enabled.
      Parameters:
      enabled - true if enabled, else false
    • getMaxIncrease

      double getMaxIncrease()
      Fetches the maximum amount that can be gained from a natural cause.
      Returns:
      Maximum Amount
    • setMaxIncrease

      void setMaxIncrease(double max)
      Sets the maximum amount that can be gained from a natural cause.
      Parameters:
      max - Maximum Amount
    • hasEnchantBonus

      boolean hasEnchantBonus()
      Whether Enchantments amplify natural causes.
      Returns:
      true if enabled, else false
    • setEnchantBonus

      void setEnchantBonus(boolean enabled)
      Sets whether Enchantments amplify natural causes.
      Parameters:
      enabled - true if enabled, else false
    • hasBounties

      boolean hasBounties()
      Whether Bounties are enabled.
      Returns:
      true if enabled, else false
    • setBountiesEnabled

      void setBountiesEnabled(boolean enabled)
      Sets whether Bounties are enabled.
      Parameters:
      enabled - true if enabled, else false
    • isBroadcastingBounties

      boolean isBroadcastingBounties()
      Whether Bounties are being broadcated.
      Returns:
      true if broadcasted, else false
    • setBroadcastingBounties

      void setBroadcastingBounties(boolean broadcast)
      Sets whether Bounties are being broadcasted.
      Parameters:
      broadcast - true if broadcasted, else false
    • getAllCustomEvents

      @NotNull @NotNull Set<NovaConfig.CustomTaxEvent> getAllCustomEvents()
      Fetches all of the Custom Tax Events in the configuration.
      Returns:
      Custom Tax Events
    • isIgnoredTax

      boolean isIgnoredTax(@NotNull @NotNull OfflinePlayer p, @Nullable @Nullable NovaConfig.CustomTaxEvent event)
      Tests if this Player is ignored
      Parameters:
      p - Player to test against
      event - Optional CustomTaxEvent to test against
      Returns:
      true if they are ignored, else false
    • isIgnoredTax

      default boolean isIgnoredTax(OfflinePlayer p)
      Tests if this Player is ignored
      Parameters:
      p - Player to test against
      Returns:
      true if they are ignored, else false
    • isAdvertisingEnabled

      boolean isAdvertisingEnabled()
      Fetches whether business advertising is enabled.
      Returns:
      true if enabled, else false
    • setAdvertisingEnabled

      void setAdvertisingEnabled(boolean enabled)
      Sets whether business advertising is enabled.
      Parameters:
      enabled - true if enabled, else false
    • getBusinessAdvertisingReward

      double getBusinessAdvertisingReward()
      Fetches the advertising reward for clicking on a business's icon.
      Returns:
      Advertising reward
    • setBusinessAdvertisingReward

      void setBusinessAdvertisingReward(double reward)
      Sets the advertising reward for clicking on a business's icon.
      Parameters:
      reward - Advertising reward
    • setLanguage

      void setLanguage(@NotNull @NotNull Language language) throws IllegalArgumentException
      Sets the current language used by the plugin.
      Parameters:
      language - Language to use
      Throws:
      IllegalArgumentException - if language is null
    • hasProductIncrease

      boolean hasProductIncrease()
      Whether Corporations gain experience from Product Purchases.
      Returns:
      true if enabled, else false
    • setProductIncrease

      void setProductIncrease(boolean enabled)
      Sets whether Corporations gain experience from Product Purchases.
      Parameters:
      enabled - true if enabled, else false
    • getProductIncreaseModifier

      double getProductIncreaseModifier()
      Fetches the multiplier to the experience of how much a Corporation gains from Product Purchases.
      Returns:
      Experience multiplier
    • setProductIncreaseModifier

      void setProductIncreaseModifier(double modifier)
      Sets the multiplier to the experience of how much a Corporation gains from Product Purchases.
      Parameters:
      modifier - Experience multiplier
    • isDatabaseEnabled

      boolean isDatabaseEnabled()
      Whether the database feature is enabled.
      Returns:
      true if enabled, else false
    • setDatabaseEnabled

      void setDatabaseEnabled(boolean enabled)
      Sets whether the database feature is enabled.
      Parameters:
      enabled - true if enabled, else false
    • getDatabaseConnection

      @Nullable @Nullable Connection getDatabaseConnection()
      Fetches the Connection instance to the database.
      Returns:
      Connection to the MySQL database, may be null
    • isDatabaseConversionEnabled

      boolean isDatabaseConversionEnabled()

      Whether the database conversion feature is enabled.

      When enabled, the plugin will automatically convert between information stored in a Database and information stored in files, both ways. This option ignores isDatabaseEnabled() and requires valid database credentials in the configuration file.

      Returns:
      true if enabled, else false
    • setDatabaseConversionEnabled

      void setDatabaseConversionEnabled(boolean enabled)
      Sets whether the database conversion feature is enabled.
      Parameters:
      enabled - true if enabled, else false
      See Also:
    • isNaturalCauseIncomeTaxEnabled

      boolean isNaturalCauseIncomeTaxEnabled()
      Fetches whether income tax on Natural Causes is enabled.
      Returns:
      true if enabled, else false
    • setNaturalCauseIncomeTaxEnabled

      void setNaturalCauseIncomeTaxEnabled(boolean enabled)
      Sets whether income tax on Natural Causes is enabled.
      Parameters:
      enabled - true if enabled, else false
    • getNaturalCauseIncomeTax

      double getNaturalCauseIncomeTax()
      Fetches the income tax percentage on Natural Causes taken from the amount and deposited into the bank.
      Returns:
      Income tax percentage
    • setNaturalCauseIncomeTax

      void setNaturalCauseIncomeTax(double tax)
      Sets the income tax percentage on Natural Causes taken from the amount and deposited into the bank.
      Parameters:
      tax - Income tax percentage
    • getNaturalCauseIncomeTaxIgnoring

      @NotNull @NotNull List<String> getNaturalCauseIncomeTaxIgnoring()
      Fetches the list of player names, vault groups and permissions exempt from income tax on Natural Causes.
      Returns:
      List of Exempt Groups
    • setNaturalCauseIncomeTaxIgnoring

      void setNaturalCauseIncomeTaxIgnoring(@Nullable @Nullable List<String> exempt)
      Sets the list of player names, vault groups and permissions exempt from income tax on Natural Causes.
      Parameters:
      exempt - List of Exempt Groups
    • isNaturalCauseIncomeTaxIgnoring

      boolean isNaturalCauseIncomeTaxIgnoring(@NotNull @NotNull OfflinePlayer p)
      Tests if this Player is exempt from income tax on Natural Causes.
      Parameters:
      p - Player to test against
      Returns:
      true if they are exempt, else false
    • isBusinessIncomeTaxEnabled

      boolean isBusinessIncomeTaxEnabled()
      Fetches whether income tax on Business Income is enabled.
      Returns:
      true if enabled, else false
    • setBusinessIncomeTaxEnabled

      void setBusinessIncomeTaxEnabled(boolean enabled)
      Sets whether income tax on Business Income is enabled.
      Parameters:
      enabled - true if enabled, else false
    • getBusinessIncomeTax

      double getBusinessIncomeTax()
      Fetches the income tax percentage on Business Income taken from the amount and deposited into the bank.
      Returns:
      Income tax percentage
    • setBusinessIncomeTax

      void setBusinessIncomeTax(double tax)
      Sets the income tax percentage on Business Income taken from the amount and deposited into the bank.
      Parameters:
      tax - Income tax percentage
    • getBusinessIncomeTaxIgnoring

      @NotNull @NotNull List<String> getBusinessIncomeTaxIgnoring()
      Fetches the list of player names, business names, vault groups and permissions exempt from income tax on Business Income.
      Returns:
      List of Exempt Groups
    • setBusinessIncomeTaxIgnoring

      void setBusinessIncomeTaxIgnoring(@Nullable @Nullable List<String> exempt)
      Sets the list of player names, business names, vault groups and permissions exempt from income tax on Business Income.
      Parameters:
      exempt - List of Exempt Groups
    • isBusinessIncomeTaxIgnoring

      boolean isBusinessIncomeTaxIgnoring(@NotNull @NotNull Business b)
      Fetches whether income tax on Business Income is enabled.
      Parameters:
      b - Business to test against
      Returns:
      true if enabled, else false