mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-08 19:51:05 +00:00
Deposit refund instead of withdrawing it
This commit is contained in:
parent
cc24669c0c
commit
51e16febe7
@ -78,7 +78,7 @@ public class ChestProtectListener implements Listener {
|
||||
} else {
|
||||
if (p.getUniqueId().equals(shop.getVendor().getUniqueId())) {
|
||||
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()) {
|
||||
plugin.debug("Economy transaction failed: " + r.errorMessage);
|
||||
p.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED,
|
||||
|
@ -775,7 +775,7 @@ public class ShopInteractListener implements Listener {
|
||||
|
||||
if (executor.getUniqueId().equals(shop.getVendor().getUniqueId())) {
|
||||
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()) {
|
||||
plugin.debug("Economy transaction failed: " + r.errorMessage);
|
||||
executor.sendMessage(LanguageUtils.getMessage(Message.ERROR_OCCURRED,
|
||||
|
Loading…
Reference in New Issue
Block a user