if (canShear) {
List<Entity> entities = entity.getNearbyEntities(radius, 2, radius);
for (Entity i : entities) {
if (EntityType.SHEEP.equals(i.getType())) {
Sheep sheep = (Sheep) i;
if ((shears > 0) && (!sheep.isSheared())) {
DyeColor color = sheep.getColor();
byte data = color.getData();
wool[data] += 1 + ((int) (Math.random() * 2.0));
sheep.setSheared(true);
--shears;
}
}
}
lastShear = now;