slightly increase corporeal eye range and update rate

Closes #200
This commit is contained in:
Ell 2021-03-21 17:41:14 +01:00
parent 2562a96e6e
commit 2c4c868982

View file

@ -29,12 +29,11 @@ public class TileEntityAnimalContainer extends TileEntityImpl implements ITickab
@Override @Override
public void tick() { public void tick() {
if (this.world.isRemote || this.world.getGameTime() % 2 != 0) if (this.world.isRemote)
return; return;
int radius = this.getRadius(); int radius = this.getRadius();
Set<AnimalEntity> animalsInRange = new HashSet<>(this.world.getEntitiesWithinAABB(AnimalEntity.class, new AxisAlignedBB(this.pos).grow(radius - 1))); Set<AnimalEntity> animalsInRange = new HashSet<>(this.world.getEntitiesWithinAABB(AnimalEntity.class, new AxisAlignedBB(this.pos).grow(radius - 1)));
List<AnimalEntity> animalsOutRange = this.world.getEntitiesWithinAABB(AnimalEntity.class, new AxisAlignedBB(this.pos).grow(radius)); List<AnimalEntity> animalsOutRange = this.world.getEntitiesWithinAABB(AnimalEntity.class, new AxisAlignedBB(this.pos).grow(radius + 1));
for (AnimalEntity animal : animalsOutRange) { for (AnimalEntity animal : animalsOutRange) {
if (animalsInRange.contains(animal)) if (animalsInRange.contains(animal))
continue; continue;