private void overrideItemPickup(final Player player, final Item item) {
        new BukkitRunnable() {
            @Override
            public void run() {
                PlayerInventory inv = player.getInventory();
                ItemStack pickup = item.getItemStack();
                boolean dosound = false;
                for (int i = 0; i < inv.getSize(); i++) {
                    if (player.hasPermission("cyom.slot.lock." + i)) {
                        continue;
                    }
                    ItemStack slot = inv.getItem(i);
                    if (slot == null || slot.getType() == Material.AIR) {
                        inv.setItem(i, pickup.clone());
                        item.remove();
                        dosound = true;
                        break;
                    } else if (slot.isSimilar(pickup)) {
                        int maxStackSize = slot.getMaxStackSize();
                        if (maxStackSize == -1) {
                            maxStackSize = 64;
                        }
                        int spaceInSlot = maxStackSize - slot.getAmount();
                        if (spaceInSlot > 0) {
                            dosound = true;
                            if (pickup.getAmount() > spaceInSlot) {
                                pickup.setAmount(pickup.getAmount() - spaceInSlot);
                                item.setItemStack(pickup);
                                slot.setAmount(maxStackSize);
                                inv.setItem(i, slot);
                                // continue;
                            } else {
                                item.remove();
                                slot.setAmount(slot.getAmount() + pickup.getAmount());
                                inv.setItem(i, slot);
                                break;
                            }
                        }
                    }
                }
                if (dosound) {
                    player.playSound(item.getLocation(), Sound.ITEM_PICKUP, 0.2f, ((random.nextFloat() - random.nextFloat()) * 0.7F + 1.0F) * 2.0F);
                }
            }
        }.runTask(plugin);
    }