diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/PostShopCreation/CreationFeeGetter.java b/src/main/java/com/Acrobot/ChestShop/Listeners/PostShopCreation/CreationFeeGetter.java index f20e11f..5d1e793 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/PostShopCreation/CreationFeeGetter.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/PostShopCreation/CreationFeeGetter.java @@ -4,10 +4,12 @@ import com.Acrobot.ChestShop.ChestShop; import com.Acrobot.ChestShop.Configuration.Messages; import com.Acrobot.ChestShop.Configuration.Properties; import com.Acrobot.ChestShop.Economy.Economy; +import com.Acrobot.ChestShop.Events.Economy.CurrencyAddEvent; import com.Acrobot.ChestShop.Events.Economy.CurrencySubtractEvent; import com.Acrobot.ChestShop.Events.ShopCreatedEvent; import com.Acrobot.ChestShop.Permission; import com.Acrobot.ChestShop.Signs.ChestShopSign; +import com.Acrobot.ChestShop.UUIDs.NameManager; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -43,6 +45,14 @@ public class CreationFeeGetter implements Listener { CurrencySubtractEvent subtractionEvent = new CurrencySubtractEvent(BigDecimal.valueOf(shopCreationPrice), player); ChestShop.callEvent(subtractionEvent); + if (!Economy.getServerAccountName().isEmpty()) { + CurrencyAddEvent currencyAddEvent = new CurrencyAddEvent( + BigDecimal.valueOf(shopCreationPrice), + NameManager.getUUID(Economy.getServerAccountName()), + player.getWorld()); + ChestShop.callEvent(currencyAddEvent); + } + player.sendMessage(Messages.prefix(Messages.SHOP_FEE_PAID.replace("%amount", Economy.formatBalance(shopCreationPrice)))); } } diff --git a/src/main/java/com/Acrobot/ChestShop/Listeners/ShopRemoval/ShopRefundListener.java b/src/main/java/com/Acrobot/ChestShop/Listeners/ShopRemoval/ShopRefundListener.java index 219583c..cfd792d 100644 --- a/src/main/java/com/Acrobot/ChestShop/Listeners/ShopRemoval/ShopRefundListener.java +++ b/src/main/java/com/Acrobot/ChestShop/Listeners/ShopRemoval/ShopRefundListener.java @@ -5,6 +5,7 @@ import com.Acrobot.ChestShop.Configuration.Messages; import com.Acrobot.ChestShop.Configuration.Properties; import com.Acrobot.ChestShop.Economy.Economy; import com.Acrobot.ChestShop.Events.Economy.CurrencyAddEvent; +import com.Acrobot.ChestShop.Events.Economy.CurrencySubtractEvent; import com.Acrobot.ChestShop.Events.ShopDestroyedEvent; import com.Acrobot.ChestShop.Permission; import com.Acrobot.ChestShop.UUIDs.NameManager; @@ -36,6 +37,14 @@ public class ShopRefundListener implements Listener { CurrencyAddEvent currencyEvent = new CurrencyAddEvent(BigDecimal.valueOf(refundPrice), owner, event.getSign().getWorld()); ChestShop.callEvent(currencyEvent); + if (!Economy.getServerAccountName().isEmpty()) { + CurrencySubtractEvent currencySubtractEvent = new CurrencySubtractEvent( + BigDecimal.valueOf(refundPrice), + NameManager.getUUID(Economy.getServerAccountName()), + event.getSign().getWorld()); + ChestShop.callEvent(currencySubtractEvent); + } + String message = Messages.SHOP_REFUNDED.replace("%amount", Economy.formatBalance(refundPrice)); event.getDestroyer().sendMessage(Messages.prefix(message)); }