Moves some config values from StarGate and into the StarGateConfig class

Renames EconomyHandler to EconomyConfig and puts it in the new config package
Moves the LanguageLoader to the config package
Fixes the explanation of chargeFreeDestination in the README
This commit is contained in:
2021-10-23 03:56:59 +02:00
parent 070e7250df
commit 2196d5b99e
18 changed files with 412 additions and 174 deletions

View File

@ -232,7 +232,7 @@ public final class PermissionHelper {
return true;
}
// Don't charge for free destination gates
return dest != null && !EconomyHandler.chargeFreeDestination && dest.getOptions().isFree();
return dest != null && !Stargate.getEconomyConfig().chargeFreeDestination() && dest.getOptions().isFree();
}
/**
@ -409,7 +409,7 @@ public final class PermissionHelper {
}
//Player cannot pay for teleportation
int cost = EconomyHandler.getUseCost(player, entrancePortal, destination);
int cost = Stargate.getEconomyConfig().getUseCost(player, entrancePortal, destination);
if (cost > 0) {
return EconomyHelper.cannotPayTeleportFee(entrancePortal, player, cost);
}