|
|
|
|
@ -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(); |
|
|
|
|
|