示例#1
0
  private Entity closest(List list) {
    double d4 = 9000D;
    Entity ent = null;

    for (int i = 0; i < list.size(); i++) {
      Entity ent1 = (Entity) list.get(i);

      boolean okay = true;
      if (ent1 instanceof AM_EntityChopper) {
        okay = false;
      } else if (ent1 instanceof EntityWolf) {
        EntityWolf ew = (EntityWolf) ent1;
        okay = AutomatonUniversal.angrywolf(ew);
      }

      if (okay) {
        double d5 = ent1.getDistanceSq(posX, posY, posZ);
        if (d5 < d4) {
          d4 = d5;
          ent = ent1;
        }
      }
    }

    return ent;
  }
示例#2
0
  private Entity closestSlime(List list) {
    double d4 = 9000D;
    Entity ent = null;

    for (int i = 0; i < list.size(); i++) {
      Entity ent1 = (Entity) list.get(i);

      double d5 = ent1.getDistanceSq(posX, posY, posZ);
      if (d5 < d4) {
        d4 = d5;
        ent = ent1;
      }
    }

    return ent;
  }