diff --git a/src/main/java/com/olliejw/oremarket/Listeners/InventoryEvents.java b/src/main/java/com/olliejw/oremarket/Listeners/InventoryEvents.java index 3f57bd2..613e1e0 100644 --- a/src/main/java/com/olliejw/oremarket/Listeners/InventoryEvents.java +++ b/src/main/java/com/olliejw/oremarket/Listeners/InventoryEvents.java @@ -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) {