Package us.teaminceptus.novaconomy.api
Interface NovaConfig
public interface NovaConfig
Configuration used for API
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classRepresents a Custom Tax Event in the configuration -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this OfflinePlayer can bypass the max withdraw amount.default booleanWhether this NovaPlayer can bypass the max withdraw amount.booleanWhether this OfflinePlayer does not automatically pay taxes.default booleanWhether this NovaPlayer does not automatically pay taxes.@NotNull Set<NovaConfig.CustomTaxEvent>Fetches all of the Custom Tax Events in the configuration.doubleFetches the advertising reward for clicking on a business's icon.static @NotNull FileFetches the folder that all Businesses are stored.static FileDeprecated.Businesses are now stored in individual filesstatic @NotNull FileConfigurationFetches the Configuration without checking its values.static FileFetches the file of the main config.yml.static NovaConfigFetches this Configuration.static @NotNull FileFetches the folder that all Corporations are stored in.@Nullable ConnectionFetches the Connection instance to the database.static FileFetches the Data Folder of this Plugin.doubleFetches the Divider used when removing money in a DeathDecrease.static FileConfigurationDeprecated.Economies are no longer stored in a single filestatic FileDeprecated.Economies are no longer stored in a single filestatic FileFetches the folder that all Economies are stored in.intFetch the farming chance of increaseintFetch the fishing chance of increasestatic @NotNull FileConfigurationFetches the functionality.yml Configuration.static @NotNull FileFetches the Functionality Configuration File.static @NotNull FileFetches the file instance of the Global Storage.static @Nullable FileConfigurationFetches the global storage configuration.doubleFetch the Interest MultiplierlongFetch how often Interest is Applied.intFetch the killing chance of increaseFetches the current language set.static LoggerFetches the Plugin's Logger.static NovaMarketFetches the Novaconomy Market.doublegetMaxConvertAmount(Economy econ) Fetches the maximum amount of money a player can convert FROM.doubleFetches the maximum amount that can be gained from a natural cause.doublegetMaxWithdrawAmount(Economy econ) Fetches the maxmimum amount of money a player can withdraw from the global bank on a daily basis.doublegetMinimumPayment(Economy econ) Fetches the Minimum amount of money a player must be taxed.intFetch the mining chance of increasestatic FileFetch the Player Directorystatic PluginFetches the plugin instance.doubleFetches the multiplier to the experience of how much a Corporation gains from Product Purchases.longFetches how often, in ticks, taxes should be automatically withdrawed from the player's balance.booleanWhether automatic tax payments are enabled.booleanWhether Bounties are enabled.booleanWhether custom tax events are enabled.booleanFetch if Death Decrease is enabled.booleanWhether Enchantments amplify natural causes.booleanFetch is Farming Increase is enabled.booleanFetch if Fishing Increase is enabled.booleanFetch if Indirect Killing (projectiles, pets) counts towards a Kill Increase.booleanFetch if Killing Increase is enabled.booleanFetch if Mining Increase is enabled.booleanWhether Notifications is turned on inside of the configuration.booleanWhether Players have to be online for taxes to be paid.booleanWhether Corporations gain experience from Product Purchases.booleanFetches whether business advertising is enabled.booleanWhether Bounties are being broadcated.booleanWhether the database conversion feature is enabled.booleanWhether the database feature is enabled.booleanisIgnoredTax(@NotNull OfflinePlayer p, @Nullable NovaConfig.CustomTaxEvent event) Tests if this Player is ignoreddefault booleanTests if this Player is ignoredbooleanFetch if Interest is Enabledstatic FileConfigurationDeprecated.Businesses are now stored in individual filesstatic @NotNull FileConfigurationLoads the configuration's values.static @NotNull FileConfigurationLoads the Functionality Configuration.static voidPrints a Throwable in the Plugin's Namespace and Format.voidReloads API Hooks (Placeholders, Vault, etc.).static voidReloads the Interest and Taxes Runnables with new values from the configuration.voidsetAdvertisingEnabled(boolean enabled) Sets whether business advertising is enabled.voidsetBountiesEnabled(boolean enabled) Sets whether Bounties are enabled.voidsetBroadcastingBounties(boolean broadcast) Sets whether Bounties are being broadcasted.voidsetBusinessAdvertisingReward(double reward) Sets the advertising reward for clicking on a business's icon.voidsetCustomTaxes(boolean enabled) Sets whether custom tax events are enabled.voidsetDatabaseConversionEnabled(boolean enabled) Sets whether the database conversion feature is enabled.voidsetDatabaseEnabled(boolean enabled) Sets whether the database feature is enabled.voidsetDeathDecrease(boolean decrease) Sets whether or not dying should decrease money.voidsetDeathDivider(double divider) Sets the divider of the Death Event.voidsetEnchantBonus(boolean enabled) Sets whether Enchantments amplify natural causes.voidsetFarmingChance(int chance) Sets the chance of farming something to increase your money.voidsetFarmingIncrease(boolean increase) Sets whether or not farming should increase money.voidsetFishingChance(int chance) Sets the chance of successfully fishing something to increase your money.voidsetInterestEnabled(boolean enabled) Sets whether or not interest is enabled.voidsetInterestMultiplier(double multiplier) Sets the interest multipliervoidsetKillChance(int chance) Sets the chance of killing something increasing your money.voidsetKillIncrease(boolean increase) Sets whether or not killing something should increase money.voidsetLanguage(@NotNull Language language) Sets the current language used by the plugin.voidsetMaxIncrease(double max) Sets the maximum amount that can be gained from a natural cause.voidsetMiningChance(int chance) Sets the chacne of mining something to increase your money.voidsetMiningIncrease(boolean increase) Sets whether or not mining should increase money.voidsetOnlineTaxes(boolean enabled) Sets whether Players have to be online for taxes to be paid.voidsetProductIncrease(boolean enabled) Sets whether Corporations gain experience from Product Purchases.voidsetProductIncreaseModifier(double modifier) Sets the multiplier to the experience of how much a Corporation gains from Product Purchases.
-
Method Details
-
getConfiguration
Fetches this Configuration.- Returns:
- this configuration
-
getMarket
Fetches the Novaconomy Market.- Returns:
- Novaconomy Market
-
getConfigFile
Fetches the file of the main config.yml.- Returns:
- Configuration File
-
getBusinessesFolder
Fetches the folder that all Businesses are stored.- Returns:
- Businesses Folder
- Since:
- 1.6.0
-
getCorporationsFolder
Fetches the folder that all Corporations are stored in.- Returns:
- Corporations Folder
- Since:
- 1.7.0
-
print
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
Fetches the plugin instance.- Returns:
- Plugin Instance
-
getPlayerDirectory
Fetch the Player Directory- Returns:
- Player Directory
-
getDataFolder
Fetches the Data Folder of this Plugin.- Returns:
- Data Folder
-
getEconomiesConfig
Deprecated.Economies are no longer stored in a single fileFetch the Economies File- Returns:
- Economies File
-
getEconomiesFile
Deprecated.Economies are no longer stored in a single fileFetches theFilerelated to ecnomies.yml.- Returns:
- File related to economies.yml
-
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.Businesses are now stored in individual filesFetches the File that businesses.yml belongs to.- Returns:
- businesses.yml File
-
getLogger
Fetches the Plugin's Logger.- Returns:
- Plugin Logger
-
loadBusinesses
Deprecated.Businesses are now stored in individual filesLoads the businesses.yml file.- Returns:
- Businesses File
-
getFunctionalityFile
Fetches the Functionality Configuration File.- Returns:
- Functionality File
-
getFunctionalityConfig
Fetches the functionality.yml Configuration.- Returns:
- Functionality Configuration
-
loadFunctionalityFile
Loads the Functionality Configuration.- Returns:
- Loaded Functionality Configuration
-
getGlobalStorage
Fetches the global storage configuration.- Returns:
- Global Storage Configuration, or null if file doesn't exist
-
getGlobalFile
Fetches the file instance of the Global Storage.- Returns:
- Global Storage File Instance
-
getConfig
Fetches the Configuration without checking its values.- Returns:
- Unchecked 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
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
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
Whether this OfflinePlayer can bypass the max withdraw amount.- Parameters:
p- Player to test against- Returns:
- true if they can, else false
-
canBypassWithdraw
Whether this NovaPlayer can bypass the max withdraw amount.- Parameters:
np- NovaPlayer to test against- Returns:
- true if they can, else false
-
canIgnoreTaxes
Whether this OfflinePlayer does not automatically pay taxes.- Parameters:
p- Player to test against- Returns:
- true if they can, else false
-
canIgnoreTaxes
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
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
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 againstevent- Optional CustomTaxEvent to test against- Returns:
- true if they are ignored, else false
-
isIgnoredTax
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
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
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:
-