public void func_72523_a(Packet102WindowClick p_72523_1_) {
    if (this.field_72574_e.field_71070_bA.field_75152_c == p_72523_1_.field_73444_a
        && this.field_72574_e.field_71070_bA.func_75129_b(this.field_72574_e)) {
      ItemStack var2 =
          this.field_72574_e.field_71070_bA.func_75144_a(
              p_72523_1_.field_73442_b,
              p_72523_1_.field_73443_c,
              p_72523_1_.field_73439_f,
              this.field_72574_e);
      if (ItemStack.func_77989_b(p_72523_1_.field_73441_e, var2)) {
        this.field_72574_e.field_71135_a.func_72567_b(
            new Packet106Transaction(p_72523_1_.field_73444_a, p_72523_1_.field_73440_d, true));
        this.field_72574_e.field_71137_h = true;
        this.field_72574_e.field_71070_bA.func_75142_b();
        this.field_72574_e.func_71113_k();
        this.field_72574_e.field_71137_h = false;
      } else {
        this.field_72586_s.func_76038_a(
            this.field_72574_e.field_71070_bA.field_75152_c,
            Short.valueOf(p_72523_1_.field_73440_d));
        this.field_72574_e.field_71135_a.func_72567_b(
            new Packet106Transaction(p_72523_1_.field_73444_a, p_72523_1_.field_73440_d, false));
        this.field_72574_e.field_71070_bA.func_75128_a(this.field_72574_e, false);
        ArrayList var3 = new ArrayList();

        for (int var4 = 0; var4 < this.field_72574_e.field_71070_bA.field_75151_b.size(); ++var4) {
          var3.add(
              ((Slot) this.field_72574_e.field_71070_bA.field_75151_b.get(var4)).func_75211_c());
        }

        this.field_72574_e.func_71110_a(this.field_72574_e.field_71070_bA, var3);
      }
    }
  }
示例#2
0
  public void func_74205_h() {
    ItemStack var1 = this.field_74193_d.func_75139_a(0).func_75211_c();
    if (!ItemStack.func_77989_b(var1, this.field_74207_v)) {
      this.field_74207_v = var1;

      do {
        this.field_74211_r +=
            (float) (this.field_74216_x.nextInt(4) - this.field_74216_x.nextInt(4));
      } while (this.field_74213_p <= this.field_74211_r + 1.0F
          && this.field_74213_p >= this.field_74211_r - 1.0F);
    }

    ++this.field_74214_o;
    this.field_74212_q = this.field_74213_p;
    this.field_74208_u = this.field_74209_t;
    boolean var2 = false;

    for (int var3 = 0; var3 < 3; ++var3) {
      if (this.field_74215_y.field_75167_g[var3] != 0) {
        var2 = true;
      }
    }

    if (var2) {
      this.field_74209_t += 0.2F;
    } else {
      this.field_74209_t -= 0.2F;
    }

    if (this.field_74209_t < 0.0F) {
      this.field_74209_t = 0.0F;
    }

    if (this.field_74209_t > 1.0F) {
      this.field_74209_t = 1.0F;
    }

    float var5 = (this.field_74211_r - this.field_74213_p) * 0.4F;
    float var4 = 0.2F;
    if (var5 < -var4) {
      var5 = -var4;
    }

    if (var5 > var4) {
      var5 = var4;
    }

    this.field_74210_s += (var5 - this.field_74210_s) * 0.9F;
    this.field_74213_p += this.field_74210_s;
  }
示例#3
0
  public void func_75142_b() {
    for (int var1 = 0; var1 < this.field_75151_b.size(); ++var1) {
      ItemStack var2 = ((Slot) this.field_75151_b.get(var1)).func_75211_c();
      ItemStack var3 = (ItemStack) this.field_75153_a.get(var1);
      if (!ItemStack.func_77989_b(var3, var2)) {
        var3 = var2 == null ? null : var2.func_77946_l();
        this.field_75153_a.set(var1, var3);

        for (int var4 = 0; var4 < this.field_75149_d.size(); ++var4) {
          ((ICrafting) this.field_75149_d.get(var4)).func_71111_a(this, var1, var3);
        }
      }
    }
  }
  public void func_72472_a(Packet15Place p_72472_1_) {
    WorldServer var2 = this.field_72573_d.func_71218_a(this.field_72574_e.field_71093_bK);
    ItemStack var3 = this.field_72574_e.field_71071_by.func_70448_g();
    boolean var4 = false;
    int var5 = p_72472_1_.func_73403_d();
    int var6 = p_72472_1_.func_73402_f();
    int var7 = p_72472_1_.func_73407_g();
    int var8 = p_72472_1_.func_73401_h();
    if (p_72472_1_.func_73401_h() == 255) {
      if (var3 == null) {
        return;
      }

      this.field_72574_e.field_71134_c.func_73085_a(this.field_72574_e, var2, var3);
    } else if (p_72472_1_.func_73402_f() >= this.field_72573_d.func_71207_Z() - 1
        && (p_72472_1_.func_73401_h() == 1
            || p_72472_1_.func_73402_f() >= this.field_72573_d.func_71207_Z())) {
      this.field_72574_e.field_71135_a.func_72567_b(
          new Packet3Chat(
              ""
                  + EnumChatFormatting.GRAY
                  + "Height limit for building is "
                  + this.field_72573_d.func_71207_Z()));
      var4 = true;
    } else {
      if (this.field_72587_r
          && this.field_72574_e.func_70092_e(
                  (double) var5 + 0.5D, (double) var6 + 0.5D, (double) var7 + 0.5D)
              < 64.0D
          && !this.field_72573_d.func_96290_a(var2, var5, var6, var7, this.field_72574_e)) {
        this.field_72574_e.field_71134_c.func_73078_a(
            this.field_72574_e,
            var2,
            var3,
            var5,
            var6,
            var7,
            var8,
            p_72472_1_.func_73406_j(),
            p_72472_1_.func_73404_l(),
            p_72472_1_.func_73408_m());
      }

      var4 = true;
    }

    if (var4) {
      this.field_72574_e.field_71135_a.func_72567_b(
          new Packet53BlockChange(var5, var6, var7, var2));
      if (var8 == 0) {
        --var6;
      }

      if (var8 == 1) {
        ++var6;
      }

      if (var8 == 2) {
        --var7;
      }

      if (var8 == 3) {
        ++var7;
      }

      if (var8 == 4) {
        --var5;
      }

      if (var8 == 5) {
        ++var5;
      }

      this.field_72574_e.field_71135_a.func_72567_b(
          new Packet53BlockChange(var5, var6, var7, var2));
    }

    var3 = this.field_72574_e.field_71071_by.func_70448_g();
    if (var3 != null && var3.field_77994_a == 0) {
      this.field_72574_e
              .field_71071_by
              .field_70462_a[this.field_72574_e.field_71071_by.field_70461_c] =
          null;
      var3 = null;
    }

    if (var3 == null || var3.func_77988_m() == 0) {
      this.field_72574_e.field_71137_h = true;
      this.field_72574_e
              .field_71071_by
              .field_70462_a[this.field_72574_e.field_71071_by.field_70461_c] =
          ItemStack.func_77944_b(
              this.field_72574_e
                  .field_71071_by
                  .field_70462_a[this.field_72574_e.field_71071_by.field_70461_c]);
      Slot var9 =
          this.field_72574_e.field_71070_bA.func_75147_a(
              this.field_72574_e.field_71071_by, this.field_72574_e.field_71071_by.field_70461_c);
      this.field_72574_e.field_71070_bA.func_75142_b();
      this.field_72574_e.field_71137_h = false;
      if (!ItemStack.func_77989_b(
          this.field_72574_e.field_71071_by.func_70448_g(), p_72472_1_.func_73405_i())) {
        this.func_72567_b(
            new Packet103SetSlot(
                this.field_72574_e.field_71070_bA.field_75152_c,
                var9.field_75222_d,
                this.field_72574_e.field_71071_by.func_70448_g()));
      }
    }
  }