mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
parent
2562a96e6e
commit
2c4c868982
1 changed files with 2 additions and 3 deletions
|
@ -29,12 +29,11 @@ public class TileEntityAnimalContainer extends TileEntityImpl implements ITickab
|
|||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (this.world.isRemote || this.world.getGameTime() % 2 != 0)
|
||||
if (this.world.isRemote)
|
||||
return;
|
||||
|
||||
int radius = this.getRadius();
|
||||
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) {
|
||||
if (animalsInRange.contains(animal))
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue