Adds the missing taxAccounts option

This commit is contained in:
2023-04-19 19:00:02 +02:00
parent 2074904aef
commit 6737a4f789
7 changed files with 68 additions and 22 deletions

View File

@@ -150,6 +150,11 @@ public enum ConfigOption {
CHARGE_FREE_DESTINATION("economy.chargeFreeDestination",
"Whether to require payment if the destination is free, but the entrance stargate is not", true),
/**
* The account to transfer all paid fees to
*/
TAX_ACCOUNT("economy.taxAccount", "The UUID of the account all fees are paid to (except for money to the Stargate owner)", ""),
/**
* Whether to mark free gates with a different color
*/

View File

@@ -132,6 +132,15 @@ public final class EconomyConfig {
return (Integer) configOptions.get(ConfigOption.DESTROY_COST);
}
/**
* Gets the account all taxes are paid to
*
* @return <p>The account all taxes are paid to</p>
*/
public String getTaxAccount() {
return (String) configOptions.get(ConfigOption.TAX_ACCOUNT);
}
/**
* Checks whether the given player can afford the given fee
*

View File

@@ -364,7 +364,8 @@ public final class StargateConfig {
FileConfiguration newConfig = Stargate.getInstance().getConfig();
boolean isMigrating = false;
if (newConfig.getString("lang") != null || newConfig.getString("economy.freeGatesGreen") != null) {
if (newConfig.getString("lang") != null || newConfig.getString("economy.freeGatesGreen") != null ||
newConfig.getString("economy.taxAccount") == null) {
migrateConfig(newConfig);
isMigrating = true;
}