    public static void shop(SignChangeEvent event) {
        Inventory chest = ChestFinder.findChest(event.getBlock());
        Block chestBlock = ChestFinder.findChestBlock(event.getBlock());
        if(chest == null) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_NoChest);
            event.getBlock().breakNaturally();
            return;
        }
        String[] lines = event.getLines();
        Integer amount;
        try {
            amount = Integer.parseInt(lines[1]);
        } catch(NumberFormatException e) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_InvalidAmount);
            event.getBlock().breakNaturally();
            return;
        }
        Matcher matcher = pattern.matcher(lines[2]);
        Float buy = 0.0F, sell = 0.0F;
        if(matcher.find()) {
            try {
                buy = Float.parseFloat(matcher.group(1));
                sell = Float.parseFloat(matcher.group(2));
            } catch(NumberFormatException e) {
                event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_InvalidBuySell);
                event.getBlock().breakNaturally();
                return;
            }
        } else {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_NoValidBuySellLine);
            event.getBlock().breakNaturally();
            return;
        }
        Boolean hasItem = false;
        ListIterator<ItemStack> itemStackListIterator = chest.iterator();
        while(itemStackListIterator.hasNext()) {
            ItemStack itemStack = itemStackListIterator.next();
            if(itemStack == null) continue;
            hasItem = true;
            break;
        }
        if(!hasItem) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_ChestIsEmpty);
            event.getBlock().breakNaturally();
            return;
        }
        com.geNAZt.RegionShop.Database.Model.Chest.store(event.getPlayer(), event.getBlock(), chestBlock, event.getPlayer().getWorld());
        com.geNAZt.RegionShop.Database.Table.Chest chest1 = com.geNAZt.RegionShop.Database.Model.Chest.get(chestBlock, event.getPlayer().getWorld(), false);
        itemStackListIterator = chest.iterator();
        Integer firstID = null;
        Byte firstData = null;
        Integer itemAmount = 0;
        ItemStack firstItemStack = null;
        while(itemStackListIterator.hasNext()) {
            ItemStack itemStack = itemStackListIterator.next();
            if(itemStack == null) continue;
            if(firstID == null) {
                firstID = itemStack.getTypeId();
                firstData = itemStack.getData().getData();
                firstItemStack = itemStack;
                if(Add.add(itemStack, event.getPlayer(), chest1, sell, buy, amount) == -1) {
                    event.getBlock().breakNaturally();
                    return;
                }
                itemAmount += itemStack.getAmount();
                continue;
            }
            if(itemStack.getTypeId() == firstID && itemStack.getData().getData() == firstData) {
                itemAmount += itemStack.getAmount();
            }
        }
        Items item = chest1.getItemStorage().getItems().iterator().next();
        item.setCurrentAmount(itemAmount);
        Database.getServer().update(item);
        item.getItemStorage().setItemAmount(itemAmount);
        Database.getServer().update(item.getItemStorage());
        ItemStack itemStack = firstItemStack.clone();
        itemStack.setAmount(1);
        org.bukkit.entity.Item droppedItem = event.getPlayer().getWorld().dropItem(new Location(event.getPlayer().getWorld(), (double) chest1.getChestX() + 0.5, (double)chest1.getChestY() + 1.2, (double)chest1.getChestZ() + 0.5), itemStack);
        droppedItem.setVelocity(new Vector(0, 0.1, 0));
        NMS.safeGuard(droppedItem);
        String itemName = ItemName.getDataName(firstItemStack) + firstItemStack.getType().toString();
        if (firstItemStack.getItemMeta().hasDisplayName()) {
            itemName = "(" + firstItemStack.getItemMeta().getDisplayName() + ")";
        }
        for(Integer line = 0; line < 4; line++) {
            event.setLine(line, ConfigManager.language.Sign_Shop_SignText.get(line).
                    replace("%player",  event.getPlayer().getName()).
                    replace("%itemname", ItemName.nicer(itemName)).
                    replace("%amount", amount.toString()).
                    replace("%sell", sell.toString()).
                    replace("%buy", buy.toString()));
        }
    }

    public static void shop(SignChangeEvent event) {
        Inventory chest = ChestFinder.findChest(event.getBlock());
        Block chestBlock = ChestFinder.findChestBlock(event.getBlock());
        if(chest == null) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_NoChest);
            event.getBlock().breakNaturally();
            return;
        }
        String[] lines = event.getLines();
        Integer amount;
        try {
            amount = Integer.parseInt(lines[1]);
        } catch(NumberFormatException e) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_InvalidAmount);
            event.getBlock().breakNaturally();
            return;
        }
        Matcher matcher = pattern.matcher(lines[2]);
        Float buy = 0.0F, sell = 0.0F;
        if(matcher.find()) {
            try {
                sell = Float.parseFloat(matcher.group(1));
                buy = Float.parseFloat(matcher.group(2));
            } catch(NumberFormatException e) {
                event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_InvalidBuySell);
                event.getBlock().breakNaturally();
                return;
            }
        } else {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_NoValidBuySellLine);
            event.getBlock().breakNaturally();
            return;
        }
        Boolean hasItem = false;
        ListIterator<ItemStack> itemStackListIterator = chest.iterator();
        while(itemStackListIterator.hasNext()) {
            ItemStack itemStack = itemStackListIterator.next();
            if(itemStack == null) continue;
            hasItem = true;
            break;
        }
        if(!hasItem) {
            event.getPlayer().sendMessage(ConfigManager.main.Chat_prefix + ConfigManager.language.Sign_Shop_ChestIsEmpty);
            event.getBlock().breakNaturally();
            return;
        }
        com.geNAZt.RegionShop.Database.Model.Chest.store(event.getPlayer(), event.getBlock(), chestBlock, event.getPlayer().getWorld());
        com.geNAZt.RegionShop.Database.Table.Chest chest1 = com.geNAZt.RegionShop.Database.Model.Chest.get(chestBlock, event.getPlayer().getWorld(), false);
        itemStackListIterator = chest.iterator();
        Integer firstID = null;
        Byte firstData = null;
        Integer itemAmount = 0;
        ItemStack firstItemStack = null;
        while(itemStackListIterator.hasNext()) {
            ItemStack itemStack = itemStackListIterator.next();
            if(itemStack == null) continue;
            if(firstID == null) {
                firstID = itemStack.getTypeId();
                firstData = itemStack.getData().getData();
                firstItemStack = itemStack;
                if(Add.add(itemStack, event.getPlayer(), chest1, sell, buy, amount) == -1) {
                    event.getBlock().breakNaturally();
                    return;
                }
                itemAmount += itemStack.getAmount();
                continue;
            }
            if(itemStack.getTypeId() == firstID && itemStack.getData().getData() == firstData) {
                itemAmount += itemStack.getAmount();
            }
        }
        Items item = chest1.getItemStorage().getItems().iterator().next();
        item.setCurrentAmount(itemAmount);
        Database.getServer().update(item);
        item.getItemStorage().setItemAmount(itemAmount);
        Database.getServer().update(item.getItemStorage());
        ItemStack itemStack = firstItemStack.clone();
        itemStack.setAmount(1);
        org.bukkit.entity.Item droppedItem = event.getPlayer().getWorld().dropItem(new Location(event.getPlayer().getWorld(), (double) chest1.getChestX() + 0.5, (double)chest1.getChestY() + 1.2, (double)chest1.getChestZ() + 0.5), itemStack);
        droppedItem.setVelocity(new Vector(0, 0.1, 0));
        NMS.safeGuard(droppedItem);
        String itemName = ItemName.getDataName(firstItemStack) + firstItemStack.getType().toString();
        if (firstItemStack.getItemMeta().hasDisplayName()) {
            itemName = "(" + firstItemStack.getItemMeta().getDisplayName() + ")";
        }
        for(Integer line = 0; line < 4; line++) {
            event.setLine(line, ConfigManager.language.Sign_Shop_SignText.get(line).
                    replace("%player",  event.getPlayer().getName()).
                    replace("%itemname", ItemName.nicer(itemName)).
                    replace("%amount", amount.toString()).
                    replace("%sell", sell.toString()).
                    replace("%buy", buy.toString()));
        }
    }
