Exemplo n.º 1
0
  public void handleFlying(Packet10Flying var1) {
    EntityPlayerSP var2 = this.mc.thePlayer;
    double var3 = var2.posX;
    double var5 = var2.posY;
    double var7 = var2.posZ;
    float var9 = var2.rotationYaw;
    float var10 = var2.rotationPitch;
    if (var1.moving) {
      var3 = var1.xPosition;
      var5 = var1.yPosition;
      var7 = var1.zPosition;
    }

    if (var1.rotating) {
      var9 = var1.yaw;
      var10 = var1.pitch;
    }

    var2.ySize = 0.0F;
    var2.motionX = var2.motionY = var2.motionZ = 0.0D;
    var2.setPositionAndRotation(var3, var5, var7, var9, var10);
    var1.xPosition = var2.posX;
    var1.yPosition = var2.boundingBox.minY;
    var1.zPosition = var2.posZ;
    var1.stance = var2.posY;

    this.netManager.addToSendQueue(var1);
    if (!this.field_1210_g) {
      this.mc.thePlayer.prevPosX = this.mc.thePlayer.posX;
      this.mc.thePlayer.prevPosY = this.mc.thePlayer.posY;
      this.mc.thePlayer.prevPosZ = this.mc.thePlayer.posZ;
      this.field_1210_g = true;

      // Spout Start
      if (SpoutClient.getInstance().isSpoutEnabled()) {
        if (FileDownloadThread.preCacheCompleted.get() == 0L) {
          return;
        }
      }
      // Spout End
      this.mc.displayGuiScreen((GuiScreen) null);
    }
  }
Exemplo n.º 2
0
  public void func_72498_a(Packet10Flying p_72498_1_) {
    WorldServer var2 = this.field_72573_d.func_71218_a(this.field_72574_e.field_71093_bK);
    this.field_72584_h = true;
    if (!this.field_72574_e.field_71136_j) {
      double var3;
      if (!this.field_72587_r) {
        var3 = p_72498_1_.field_73543_b - this.field_72589_p;
        if (p_72498_1_.field_73545_a == this.field_72579_o
            && var3 * var3 < 0.01D
            && p_72498_1_.field_73544_c == this.field_72588_q) {
          this.field_72587_r = true;
        }
      }

      if (this.field_72587_r) {
        double var5;
        double var7;
        double var9;
        double var11;
        float var13;
        float var14;
        double var15;
        if (this.field_72574_e.field_70154_o != null) {
          var13 = this.field_72574_e.field_70177_z;
          var14 = this.field_72574_e.field_70125_A;
          this.field_72574_e.field_70154_o.func_70043_V();
          var5 = this.field_72574_e.field_70165_t;
          var7 = this.field_72574_e.field_70163_u;
          var9 = this.field_72574_e.field_70161_v;
          var15 = 0.0D;
          var11 = 0.0D;
          if (p_72498_1_.field_73547_i) {
            var13 = p_72498_1_.field_73542_e;
            var14 = p_72498_1_.field_73539_f;
          }

          if (p_72498_1_.field_73546_h
              && p_72498_1_.field_73543_b == -999.0D
              && p_72498_1_.field_73541_d == -999.0D) {
            if (Math.abs(p_72498_1_.field_73545_a) > 1.0D
                || Math.abs(p_72498_1_.field_73544_c) > 1.0D) {
              System.err.println(
                  this.field_72574_e.field_71092_bJ
                      + " was caught trying to crash the server with an invalid position.");
              this.func_72565_c("Nope!");
              return;
            }

            var15 = p_72498_1_.field_73545_a;
            var11 = p_72498_1_.field_73544_c;
          }

          this.field_72574_e.field_70122_E = p_72498_1_.field_73540_g;
          this.field_72574_e.func_71127_g();
          this.field_72574_e.func_70091_d(var15, 0.0D, var11);
          this.field_72574_e.func_70080_a(var5, var7, var9, var13, var14);
          this.field_72574_e.field_70159_w = var15;
          this.field_72574_e.field_70179_y = var11;
          if (this.field_72574_e.field_70154_o != null) {
            var2.func_73050_b(this.field_72574_e.field_70154_o, true);
          }

          if (this.field_72574_e.field_70154_o != null) {
            this.field_72574_e.field_70154_o.func_70043_V();
          }

          this.field_72573_d.func_71203_ab().func_72358_d(this.field_72574_e);
          this.field_72579_o = this.field_72574_e.field_70165_t;
          this.field_72589_p = this.field_72574_e.field_70163_u;
          this.field_72588_q = this.field_72574_e.field_70161_v;
          var2.func_72870_g(this.field_72574_e);
          return;
        }

        if (this.field_72574_e.func_70608_bn()) {
          this.field_72574_e.func_71127_g();
          this.field_72574_e.func_70080_a(
              this.field_72579_o,
              this.field_72589_p,
              this.field_72588_q,
              this.field_72574_e.field_70177_z,
              this.field_72574_e.field_70125_A);
          var2.func_72870_g(this.field_72574_e);
          return;
        }

        var3 = this.field_72574_e.field_70163_u;
        this.field_72579_o = this.field_72574_e.field_70165_t;
        this.field_72589_p = this.field_72574_e.field_70163_u;
        this.field_72588_q = this.field_72574_e.field_70161_v;
        var5 = this.field_72574_e.field_70165_t;
        var7 = this.field_72574_e.field_70163_u;
        var9 = this.field_72574_e.field_70161_v;
        var13 = this.field_72574_e.field_70177_z;
        var14 = this.field_72574_e.field_70125_A;
        if (p_72498_1_.field_73546_h
            && p_72498_1_.field_73543_b == -999.0D
            && p_72498_1_.field_73541_d == -999.0D) {
          p_72498_1_.field_73546_h = false;
        }

        if (p_72498_1_.field_73546_h) {
          var5 = p_72498_1_.field_73545_a;
          var7 = p_72498_1_.field_73543_b;
          var9 = p_72498_1_.field_73544_c;
          var11 = p_72498_1_.field_73541_d - p_72498_1_.field_73543_b;
          if (!this.field_72574_e.func_70608_bn() && (var11 > 1.65D || var11 < 0.1D)) {
            this.func_72565_c("Illegal stance");
            this.field_72573_d
                .func_98033_al()
                .func_98236_b(
                    this.field_72574_e.field_71092_bJ + " had an illegal stance: " + var11);
            return;
          }

          if (Math.abs(p_72498_1_.field_73545_a) > 3.2E7D
              || Math.abs(p_72498_1_.field_73544_c) > 3.2E7D) {
            this.func_72565_c("Illegal position");
            return;
          }
        }

        if (p_72498_1_.field_73547_i) {
          var13 = p_72498_1_.field_73542_e;
          var14 = p_72498_1_.field_73539_f;
        }

        this.field_72574_e.func_71127_g();
        this.field_72574_e.field_70139_V = 0.0F;
        this.field_72574_e.func_70080_a(
            this.field_72579_o, this.field_72589_p, this.field_72588_q, var13, var14);
        if (!this.field_72587_r) {
          return;
        }

        var11 = var5 - this.field_72574_e.field_70165_t;
        var15 = var7 - this.field_72574_e.field_70163_u;
        double var17 = var9 - this.field_72574_e.field_70161_v;
        double var19 = Math.min(Math.abs(var11), Math.abs(this.field_72574_e.field_70159_w));
        double var21 = Math.min(Math.abs(var15), Math.abs(this.field_72574_e.field_70181_x));
        double var23 = Math.min(Math.abs(var17), Math.abs(this.field_72574_e.field_70179_y));
        double var25 = var19 * var19 + var21 * var21 + var23 * var23;
        if (var25 > 100.0D
            && (!this.field_72573_d.func_71264_H()
                || !this.field_72573_d.func_71214_G().equals(this.field_72574_e.field_71092_bJ))) {
          this.field_72573_d
              .func_98033_al()
              .func_98236_b(
                  this.field_72574_e.field_71092_bJ
                      + " moved too quickly! "
                      + var11
                      + ","
                      + var15
                      + ","
                      + var17
                      + " ("
                      + var19
                      + ", "
                      + var21
                      + ", "
                      + var23
                      + ")");
          this.func_72569_a(
              this.field_72579_o,
              this.field_72589_p,
              this.field_72588_q,
              this.field_72574_e.field_70177_z,
              this.field_72574_e.field_70125_A);
          return;
        }

        float var27 = 0.0625F;
        boolean var28 =
            var2.func_72945_a(
                    this.field_72574_e,
                    this.field_72574_e
                        .field_70121_D
                        .func_72329_c()
                        .func_72331_e((double) var27, (double) var27, (double) var27))
                .isEmpty();
        if (this.field_72574_e.field_70122_E && !p_72498_1_.field_73540_g && var15 > 0.0D) {
          this.field_72574_e.func_71020_j(0.2F);
        }

        this.field_72574_e.func_70091_d(var11, var15, var17);
        this.field_72574_e.field_70122_E = p_72498_1_.field_73540_g;
        this.field_72574_e.func_71000_j(var11, var15, var17);
        double var29 = var15;
        var11 = var5 - this.field_72574_e.field_70165_t;
        var15 = var7 - this.field_72574_e.field_70163_u;
        if (var15 > -0.5D || var15 < 0.5D) {
          var15 = 0.0D;
        }

        var17 = var9 - this.field_72574_e.field_70161_v;
        var25 = var11 * var11 + var15 * var15 + var17 * var17;
        boolean var31 = false;
        if (var25 > 0.0625D
            && !this.field_72574_e.func_70608_bn()
            && !this.field_72574_e.field_71134_c.func_73083_d()) {
          var31 = true;
          this.field_72573_d
              .func_98033_al()
              .func_98236_b(this.field_72574_e.field_71092_bJ + " moved wrongly!");
        }

        this.field_72574_e.func_70080_a(var5, var7, var9, var13, var14);
        boolean var32 =
            var2.func_72945_a(
                    this.field_72574_e,
                    this.field_72574_e
                        .field_70121_D
                        .func_72329_c()
                        .func_72331_e((double) var27, (double) var27, (double) var27))
                .isEmpty();
        if (var28 && (var31 || !var32) && !this.field_72574_e.func_70608_bn()) {
          this.func_72569_a(
              this.field_72579_o, this.field_72589_p, this.field_72588_q, var13, var14);
          return;
        }

        AxisAlignedBB var33 =
            this.field_72574_e
                .field_70121_D
                .func_72329_c()
                .func_72314_b((double) var27, (double) var27, (double) var27)
                .func_72321_a(0.0D, -0.55D, 0.0D);
        if (!this.field_72573_d.func_71231_X()
            && !this.field_72574_e.field_71134_c.func_73083_d()
            && !var2.func_72829_c(var33)) {
          if (var29 >= -0.03125D) {
            ++this.field_72572_g;
            if (this.field_72572_g > 80) {
              this.field_72573_d
                  .func_98033_al()
                  .func_98236_b(
                      this.field_72574_e.field_71092_bJ + " was kicked for floating too long!");
              this.func_72565_c("Flying is not enabled on this server");
              return;
            }
          }
        } else {
          this.field_72572_g = 0;
        }

        this.field_72574_e.field_70122_E = p_72498_1_.field_73540_g;
        this.field_72573_d.func_71203_ab().func_72358_d(this.field_72574_e);
        this.field_72574_e.func_71122_b(
            this.field_72574_e.field_70163_u - var3, p_72498_1_.field_73540_g);
      }
    }
  }