Skip to content

Commit

Permalink
what was this, oh no
Browse files Browse the repository at this point in the history
  • Loading branch information
Thatsmusic99 committed May 8, 2020
1 parent 6a28473 commit 00d0b69
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/io/github/at/utilities/PaymentManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@ public class PaymentManager {

// Method used to check if a player can pay for using a command
public static boolean canPay(String command, Player player) {
if (Config.isUsingEXPPayment(command)){
if (player.getLevel()<Config.getEXPTeleportPrice(command)){
player.sendMessage(CustomMessages.getString("Error.notEnoughEXP").replaceAll("\\{levels}", String.valueOf(Config.getEXPTeleportPrice(command))));
return false;
if (!player.hasPermission("at.admin.bypass")) {
if (Config.isUsingEXPPayment(command)){
if (player.getLevel()<Config.getEXPTeleportPrice(command)){
player.sendMessage(CustomMessages.getString("Error.notEnoughEXP").replaceAll("\\{levels}", String.valueOf(Config.getEXPTeleportPrice(command))));
return false;
}
}
}
if (CoreClass.getVault() != null && Config.isUsingVault(command)) {
if (CoreClass.getVault().getBalance(player)<Config.getTeleportPrice(command)){
player.sendMessage(CustomMessages.getString("Error.notEnoughMoney").replaceAll("\\{amount}", String.valueOf(Config.getTeleportPrice(command))));
return false;
if (CoreClass.getVault() != null && Config.isUsingVault(command)) {
if (CoreClass.getVault().getBalance(player)<Config.getTeleportPrice(command)){
player.sendMessage(CustomMessages.getString("Error.notEnoughMoney").replaceAll("\\{amount}", String.valueOf(Config.getTeleportPrice(command))));
return false;
}
}
}
return true;
Expand Down

0 comments on commit 00d0b69

Please sign in to comment.