Deposit refund instead of withdrawing it

This commit is contained in:
Eric 2018-11-04 14:21:14 +01:00
parent cc24669c0c
commit 51e16febe7
2 changed files with 2 additions and 2 deletions

View File

@ -78,7 +78,7 @@ public class ChestProtectListener implements Listener {
} else { } else {
if (p.getUniqueId().equals(shop.getVendor().getUniqueId())) { if (p.getUniqueId().equals(shop.getVendor().getUniqueId())) {
double creationPrice = shop.getShopType() == ShopType.ADMIN ? Config.shopCreationPriceAdmin : Config.shopCreationPriceNormal; double creationPrice = shop.getShopType() == ShopType.ADMIN ? Config.shopCreationPriceAdmin : Config.shopCreationPriceNormal;
EconomyResponse r = plugin.getEconomy().withdrawPlayer(p, shop.getLocation().getWorld().getName(), creationPrice); EconomyResponse r = plugin.getEconomy().depositPlayer(p, shop.getLocation().getWorld().getName(), creationPrice);
if (!r.transactionSuccess()) { if (!r.transactionSuccess()) {
plugin.debug("Economy transaction failed: " + r.errorMessage); plugin.debug("Economy transaction failed: " + r.errorMessage);
p.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED, p.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED,

View File

@ -775,7 +775,7 @@ public class ShopInteractListener implements Listener {
if (executor.getUniqueId().equals(shop.getVendor().getUniqueId())) { if (executor.getUniqueId().equals(shop.getVendor().getUniqueId())) {
double creationPrice = shop.getShopType() == ShopType.ADMIN ? Config.shopCreationPriceAdmin : Config.shopCreationPriceNormal; double creationPrice = shop.getShopType() == ShopType.ADMIN ? Config.shopCreationPriceAdmin : Config.shopCreationPriceNormal;
EconomyResponse r = plugin.getEconomy().withdrawPlayer(executor, shop.getLocation().getWorld().getName(), creationPrice); EconomyResponse r = plugin.getEconomy().depositPlayer(executor, shop.getLocation().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, executor.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED,