Example #1
0
  private void setNewWayPoint(SSEntityScriptedSurvivor ess) {
    boolean flag = false;
    int j = -1;
    int k = -1;
    int l = -1;
    float f2 = -99999F;
    ess.coords = null;
    for (int i1 = 0; i1 < 10; i1++) {
      int j1 = MathHelper.floor_double((ess.posX + (double) ess.getRNG().nextInt(21)) - 10D);
      int k1 = MathHelper.floor_double((ess.posY + (double) ess.getRNG().nextInt(7)) - 3D);
      int l1 = MathHelper.floor_double((ess.posZ + (double) ess.getRNG().nextInt(21)) - 10D);
      float f3 = isTargetBlock(ess, j1, k1, l1) ? 1000F : (float) ess.getDistance(j1, k1, l1);
      if (f3 == 1000F) {
        j = j1;
        k = k1;
        l = l1;
        ess.coords = new int[3];
        ess.coords[0] = j;
        ess.coords[1] = k;
        ess.coords[2] = l;
        flag = true;
        break;
      } else if (f3 > f2) {
        f2 = f3;
        j = j1;
        k = k1;
        l = l1;
        flag = true;
      }
    }

    if (flag) {
      ess.path = ess.worldObj.getEntityPathToXYZ(ess, j, k, l, 18F);
    }
  }
Example #2
0
 public boolean isActionComplete(SSEntityScriptedSurvivor ess) {
   if (ess.coords != null && ess.getDistance(ess.coords[0], ess.coords[1], ess.coords[2]) < 2D)
     return true;
   return ess.actionTimer >= maxTicksToLook;
 }
Example #3
0
 private boolean nearCoords(SSEntityScriptedSurvivor ess) {
   if (ess.coords == null || ess.getDistance(ess.coords[0], ess.coords[1], ess.coords[2]) > range)
     return false;
   return true;
 }