From 71e6b4ac16eb8a89fbb11cfca63645aba0d65f9b Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 29 Jan 2023 14:25:57 +0000 Subject: [PATCH] Tweak search ranges for the butterfly ai --- .../com/minelittlepony/unicopia/entity/ButterflyEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/ButterflyEntity.java b/src/main/java/com/minelittlepony/unicopia/entity/ButterflyEntity.java index 06fdfae3..1155446c 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/ButterflyEntity.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/ButterflyEntity.java @@ -177,7 +177,7 @@ public class ButterflyEntity extends AmbientEntity { } if (world.getBlockState(below).isAir() - || !world.getOtherEntities(this, getBoundingBox().expand(7), this::isAggressor).isEmpty() + || !world.getOtherEntities(this, getBoundingBox().expand(3), this::isAggressor).isEmpty() || (ticksResting++ > MAX_REST_TICKS || world.random.nextInt(500) == 0) || world.hasRain(below)) { setResting(false); @@ -212,7 +212,7 @@ public class ButterflyEntity extends AmbientEntity { } private boolean canBreed() { - return age > BREEDING_INTERVAL && breedingCooldown <= 0 && isResting() && world.getOtherEntities(this, getBoundingBox().expand(20), i -> { + return age > BREEDING_INTERVAL && breedingCooldown <= 0 && isResting() && world.getOtherEntities(this, getBoundingBox().expand(2), i -> { return i instanceof ButterflyEntity && i.getType() == getType() && ((ButterflyEntity)i).isResting(); }).size() == 1; }