mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-14 16:49:09 +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
|
@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;
|
||||||
|
|
Loading…
Reference in a new issue