Beispiel #1
0
  /** Returns whether the EntityAIBase should begin execution. */
  public boolean shouldExecute() {
    if (!this.theEntity.isCollidedHorizontally) {
      return false;
    } else {
      PathNavigateGround var1 = (PathNavigateGround) this.theEntity.getNavigator();
      PathEntity var2 = var1.getPath();

      if (var2 != null && !var2.isFinished() && var1.func_179686_g()) {
        for (int var3 = 0;
            var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength());
            ++var3) {
          PathPoint var4 = var2.getPathPointFromIndex(var3);
          this.field_179507_b = new BlockPos(var4.xCoord, var4.yCoord + 1, var4.zCoord);

          if (this.theEntity.getDistanceSq(
                  (double) this.field_179507_b.getX(),
                  this.theEntity.posY,
                  (double) this.field_179507_b.getZ())
              <= 2.25D) {
            this.doorBlock = this.func_179506_a(this.field_179507_b);

            if (this.doorBlock != null) {
              return true;
            }
          }
        }

        this.field_179507_b = (new BlockPos(this.theEntity)).offsetUp();
        this.doorBlock = this.func_179506_a(this.field_179507_b);
        return this.doorBlock != null;
      } else {
        return false;
      }
    }
  }
Beispiel #2
0
  public boolean func_75484_a(PathEntity p_75484_1_, double p_75484_2_) {
    if (p_75484_1_ == null) {
      this.field_75514_c = null;
      return false;
    } else {
      if (!p_75484_1_.func_75876_a(this.field_75514_c)) {
        this.field_75514_c = p_75484_1_;
      }

      if (this.field_75509_f) {
        this.func_75487_m();
      }

      if (this.field_75514_c.func_75874_d() == 0) {
        return false;
      } else {
        this.field_75511_d = p_75484_2_;
        Vec3 var4 = this.func_75502_i();
        this.field_75520_h = this.field_75510_g;
        this.field_75521_i.field_72450_a = var4.field_72450_a;
        this.field_75521_i.field_72448_b = var4.field_72448_b;
        this.field_75521_i.field_72449_c = var4.field_72449_c;
        return true;
      }
    }
  }