Skip to content

Commit

Permalink
Merge pull request #2 from emmanuelvlad/feat-bypass-permission
Browse files Browse the repository at this point in the history
feat: bypass tax permission
  • Loading branch information
Brannstroom committed Jun 7, 2023
2 parents 774b60d + 059ceaa commit 841cd08
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
if(StringUtils.isNumeric(args[0])) {
int xp = Integer.parseInt(args[0]);
if(xp <= InfoKeeper.maxXp && xp >= InfoKeeper.minXp) {
if(InfoKeeper.tax) {
if(InfoKeeper.tax && !player.hasPermission("expbottle.bypasstax")) {
double price = (xp*(1+InfoKeeper.taxAmount));
if(price <= Experience.getExp(player)) {
player.sendMessage(InfoKeeper.getInfoKeeper(player, InfoKeeper.successfulWithdraw, xp, Experience.getExp(player)));
Expand All @@ -56,7 +56,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
}else if(args[0].equalsIgnoreCase("all") || InfoKeeper.allAliases.contains(args[0])) {
int xp = Experience.getExp(player);
if(xp <= InfoKeeper.maxXp && xp >= InfoKeeper.minXp) {
if(InfoKeeper.tax) {
if(InfoKeeper.tax && !player.hasPermission("expbottle.bypasstax")) {
player.sendMessage(InfoKeeper.getInfoKeeper(player, InfoKeeper.successfulWithdraw, (int) (xp/(1+InfoKeeper.taxAmount)), Experience.getExp(player)));
MainHandler.givePlayerExpBottle(player, (int) (xp/(1+InfoKeeper.taxAmount)));
MainHandler.removePlayerExp(player, xp);
Expand Down Expand Up @@ -118,4 +118,4 @@ else if(args[0].equalsIgnoreCase("reload") || InfoKeeper.reloadAliases.contains(
}
return true;
}
}
}

0 comments on commit 841cd08

Please sign in to comment.