private boolean tryCulling(List<Integer> targets) { int entityId; Entity entity; EntityAnimal animal; int fortune = getUpgrades().contains(WorksiteUpgrade.ENCHANTED_TOOLS_1) ? 1 : getUpgrades().contains(WorksiteUpgrade.ENCHANTED_TOOLS_2) ? 2 : 0; while (!targets.isEmpty()) { entityId = targets.remove(0); entity = worldObj.getEntityByID(entityId); if (entity instanceof EntityAnimal) { animal = (EntityAnimal) entity; if (animal.isInLove() || animal.getGrowingAge() < 0) { continue; } animal.captureDrops = true; animal.captureDrops = true; animal.arrowHitTimer = 10; animal.attackEntityFrom(DamageSource.generic, animal.getHealth() + 1); ItemStack stack; for (EntityItem item : animal.capturedDrops) { stack = item.getEntityItem(); if (fortune > 0) { stack.stackSize += worldObj.rand.nextInt(fortune); } this.addStackToInventory(stack, RelativeSide.TOP); item.setDead(); } return true; } } return false; }