From 50191c196429202189c59d2ffbf70c4e569f663b Mon Sep 17 00:00:00 2001 From: jakub Date: Sun, 8 Jun 2025 22:53:28 +0200 Subject: [PATCH] ik --- .../soukup/ecoCraftCore/events/ShopLogic.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/soukup/ecoCraftCore/events/ShopLogic.java b/src/main/java/xyz/soukup/ecoCraftCore/events/ShopLogic.java index c4cf277..3ca1bd0 100644 --- a/src/main/java/xyz/soukup/ecoCraftCore/events/ShopLogic.java +++ b/src/main/java/xyz/soukup/ecoCraftCore/events/ShopLogic.java @@ -44,11 +44,6 @@ public class ShopLogic implements Listener { return; } - if (VirtualChestLogic.openedChests.containsKey(id)){ - event.getPlayer().sendPlainMessage("to by neslo"); - return; - } - Shop shop = Shop.findById(id); if (shop == null){ @@ -57,6 +52,11 @@ public class ShopLogic implements Listener { event.setCancelled(true); + if (VirtualChestLogic.openedChests.containsKey(shop.getVirtualChestID())){ + event.getPlayer().sendPlainMessage("to by neslo"); + return; + } + Player player = event.getPlayer(); Gui gui = buildShopGui(player, shop); @@ -138,6 +138,12 @@ public class ShopLogic implements Listener { } public static void buy(Shop shop, Player player, int multiplier){ + + if (VirtualChestLogic.openedChests.containsKey(shop.getVirtualChestID())){ + player.sendPlainMessage("to by neslo"); + return; + } + int amount = shop.getAmount() * multiplier; float price = shop.getPriceBuy() * multiplier; ItemStack itemStack = shop.getItemStack(); @@ -179,6 +185,12 @@ public class ShopLogic implements Listener { } public static void sell(Shop shop, Player player, int multiplier){ + + if (VirtualChestLogic.openedChests.containsKey(shop.getVirtualChestID())){ + player.sendPlainMessage("to by neslo"); + return; + } + int amount = shop.getAmount() * multiplier; float price = shop.getPriceSell() * multiplier; ItemStack itemStack = shop.getItemStack();