All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.minecraft.server.EntitySenses Maven / Gradle / Ivy

There is a newer version: 2.4.0
Show newest version
package net.minecraft.server;

import com.google.common.collect.Lists;

import java.util.List;

public class EntitySenses {

  EntityInsentient a;
  List b = Lists.newArrayList();
  List c = Lists.newArrayList();

  public EntitySenses(EntityInsentient entityinsentient) {
    this.a = entityinsentient;
  }

  public void a() {
    this.b.clear();
    this.c.clear();
  }

  public boolean a(Entity entity) {
    if (this.b.contains(entity)) {
      return true;
    } else if (this.c.contains(entity)) {
      return false;
    } else {
      this.a.world.methodProfiler.a("canSee");
      boolean flag = this.a.hasLineOfSight(entity);

      this.a.world.methodProfiler.b();
      if (flag) {
        this.b.add(entity);
      } else {
        this.c.add(entity);
      }

      return flag;
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy