Only withdraw creation price if higher than zero

Fixes #285
This commit is contained in:
Eric 2019-12-15 15:35:42 +01:00
parent 8ed16d7f3f
commit fd5ebd0921

View File

@ -484,12 +484,14 @@ public class ShopInteractListener implements Listener {
return; return;
} }
if (creationPrice > 0) {
EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, location.getWorld().getName(), creationPrice); EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, location.getWorld().getName(), creationPrice);
if (!r.transactionSuccess()) { if (!r.transactionSuccess()) {
plugin.debug("Economy transaction failed: " + r.errorMessage); plugin.debug("Economy transaction failed: " + r.errorMessage);
executor.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED, new Replacement(Placeholder.ERROR, r.errorMessage))); executor.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED, new Replacement(Placeholder.ERROR, r.errorMessage)));
return; return;
} }
}
shop.create(true); shop.create(true);