double distance;
for (Entity e : entity.getNearbyEntities(2.0)) {
if (!(e instanceof Item) || EntityUtil.isIgnored(e)) {
continue;
}
ItemStack stack = ((Item) e).getItemStack();
distance = entity.loc.distanceSquared(e);
if (ItemUtil.testTransfer(stack, inv) == stack.getAmount()) {
if (distance < 0.7) {
ItemUtil.transfer(stack, inv, Integer.MAX_VALUE);
// This.world.playNote
entity.getWorld().playEffect(entity.getLocation(), Effect.CLICK1, 0);
if (stack.getAmount() == 0) {
e.remove();
continue;
}
} else {
final double factor;