@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onPickUpItemIntoLockedSlot(PlayerPickupItemEvent event) {
        Player player = event.getPlayer();
        if (player.hasPermission("disable.slot.locking")) {
            return;
        }
        PlayerInventory inv = player.getInventory();
        ItemStack pickup = event.getItem().getItemStack();
        int toAdd = pickup.getAmount() - event.getRemaining();
        for (int i = 0; i < inv.getSize(); i++) {
            ItemStack slot = inv.getItem(i);
            if (slot == null || slot.getType() == Material.AIR) {
                if (player.hasPermission("cyom.slot.lock." + i)) {
                    event.setCancelled(true);
                    overrideItemPickup(player, event.getItem());
                }
                break;
            } else if (slot.isSimilar(pickup) && slot.getAmount() < slot.getMaxStackSize()) {
                toAdd -= slot.getMaxStackSize() - slot.getAmount();
                if (toAdd <= 0) {
                    break;
                }
            }
        }
    }