diff --git a/SaneEconomyCore/pom.xml b/SaneEconomyCore/pom.xml index b7feabc..7eff287 100644 --- a/SaneEconomyCore/pom.xml +++ b/SaneEconomyCore/pom.xml @@ -6,10 +6,10 @@ org.appledash SaneEconomy - 0.6.1-SNAPSHOT + 0.6.2-SNAPSHOT SaneEconomyCore - 0.6.1-SNAPSHOT + 0.6.2-SNAPSHOT diff --git a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java index 08e5c63..122416b 100644 --- a/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java +++ b/SaneEconomyCore/src/main/java/org/appledash/saneeconomy/vault/EconomySaneEconomy.java @@ -141,11 +141,19 @@ public EconomyResponse withdrawPlayer(String playerName, double v) { economable = Economable.wrap(playerName); } + if (!has(playerName, v)) { + return new EconomyResponse(v, getBalance(playerName), EconomyResponse.ResponseType.FAILURE, "Insufficient funds."); + } + return new EconomyResponse(v, SaneEconomy.getInstance().getEconomyManager().subtractBalance(economable, v), EconomyResponse.ResponseType.SUCCESS, null); } @Override public EconomyResponse withdrawPlayer(OfflinePlayer offlinePlayer, double v) { + if (!has(offlinePlayer, v)) { + return new EconomyResponse(v, getBalance(offlinePlayer), EconomyResponse.ResponseType.FAILURE, "Insufficient funds."); + } + return new EconomyResponse(v, SaneEconomy.getInstance().getEconomyManager().subtractBalance(Economable.wrap(offlinePlayer), v), EconomyResponse.ResponseType.SUCCESS, null); } diff --git a/pom.xml b/pom.xml index 0bcac4b..18ffda2 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.appledash SaneEconomy - 0.6.1-SNAPSHOT + 0.6.2-SNAPSHOT pom