mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Tweak search ranges for the butterfly ai
This commit is contained in:
parent
8a13b02809
commit
71e6b4ac16
1 changed files with 2 additions and 2 deletions
|
@ -177,7 +177,7 @@ public class ButterflyEntity extends AmbientEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world.getBlockState(below).isAir()
|
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)
|
|| (ticksResting++ > MAX_REST_TICKS || world.random.nextInt(500) == 0)
|
||||||
|| world.hasRain(below)) {
|
|| world.hasRain(below)) {
|
||||||
setResting(false);
|
setResting(false);
|
||||||
|
@ -212,7 +212,7 @@ public class ButterflyEntity extends AmbientEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean canBreed() {
|
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();
|
return i instanceof ButterflyEntity && i.getType() == getType() && ((ButterflyEntity)i).isResting();
|
||||||
}).size() == 1;
|
}).size() == 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue