pull/6/head
jakub 10 months ago
parent 152eebcfe6
commit 50191c1964
  1. 22
      src/main/java/xyz/soukup/ecoCraftCore/events/ShopLogic.java

@ -44,11 +44,6 @@ public class ShopLogic implements Listener {
return; return;
} }
if (VirtualChestLogic.openedChests.containsKey(id)){
event.getPlayer().sendPlainMessage("to by neslo");
return;
}
Shop shop = Shop.findById(id); Shop shop = Shop.findById(id);
if (shop == null){ if (shop == null){
@ -57,6 +52,11 @@ public class ShopLogic implements Listener {
event.setCancelled(true); event.setCancelled(true);
if (VirtualChestLogic.openedChests.containsKey(shop.getVirtualChestID())){
event.getPlayer().sendPlainMessage("to by neslo");
return;
}
Player player = event.getPlayer(); Player player = event.getPlayer();
Gui gui = buildShopGui(player, shop); Gui gui = buildShopGui(player, shop);
@ -138,6 +138,12 @@ public class ShopLogic implements Listener {
} }
public static void buy(Shop shop, Player player, int multiplier){ 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; int amount = shop.getAmount() * multiplier;
float price = shop.getPriceBuy() * multiplier; float price = shop.getPriceBuy() * multiplier;
ItemStack itemStack = shop.getItemStack(); ItemStack itemStack = shop.getItemStack();
@ -179,6 +185,12 @@ public class ShopLogic implements Listener {
} }
public static void sell(Shop shop, Player player, int multiplier){ 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; int amount = shop.getAmount() * multiplier;
float price = shop.getPriceSell() * multiplier; float price = shop.getPriceSell() * multiplier;
ItemStack itemStack = shop.getItemStack(); ItemStack itemStack = shop.getItemStack();

Loading…
Cancel
Save