Implement handling 0% tax

This commit is contained in:
ChronosX88 2021-08-04 01:49:43 +03:00
parent 05627a4b33
commit 841779c52b
Signed by: ChronosXYZ
GPG Key ID: 085A69A82C8C511A

View File

@ -32,8 +32,13 @@ public class InventoryEvents implements Listener {
OreMarket.getEconomy().depositPlayer((OfflinePlayer) Player, Money);
}
public void takeMoney (double Money, HumanEntity Player) { // Buy
double tax = OreMarket.main().getConfig().getDouble("tax");
double total = (Money + (Money/tax));
double tax = OreMarket.main().getConfig().getDouble("tax", 0.0);
double total;
if (tax == 0.0) {
total = Money;
} else {
total = (Money + (Money/tax));
}
OreMarket.getEconomy().withdrawPlayer((OfflinePlayer) Player, total);
}
public double balance (HumanEntity Player) {