Exemplo n.º 1
0
 public void func_75134_a(EntityPlayer p_75134_1_) {
   InventoryPlayer var2 = p_75134_1_.field_71071_by;
   if (var2.func_70445_o() != null) {
     p_75134_1_.func_71021_b(var2.func_70445_o());
     var2.func_70437_b((ItemStack) null);
   }
 }
Exemplo n.º 2
0
  public ItemStack func_75144_a(
      int p_75144_1_, int p_75144_2_, int p_75144_3_, EntityPlayer p_75144_4_) {
    ItemStack var5 = null;
    InventoryPlayer var6 = p_75144_4_.field_71071_by;
    Slot var7;
    ItemStack var8;
    int var10;
    ItemStack var11;
    if ((p_75144_3_ == 0 || p_75144_3_ == 1) && (p_75144_2_ == 0 || p_75144_2_ == 1)) {
      if (p_75144_1_ == -999) {
        if (var6.func_70445_o() != null && p_75144_1_ == -999) {
          if (p_75144_2_ == 0) {
            p_75144_4_.func_71021_b(var6.func_70445_o());
            var6.func_70437_b((ItemStack) null);
          }

          if (p_75144_2_ == 1) {
            p_75144_4_.func_71021_b(var6.func_70445_o().func_77979_a(1));
            if (var6.func_70445_o().field_77994_a == 0) {
              var6.func_70437_b((ItemStack) null);
            }
          }
        }
      } else if (p_75144_3_ == 1) {
        var7 = (Slot) this.field_75151_b.get(p_75144_1_);
        if (var7 != null && var7.func_82869_a(p_75144_4_)) {
          var8 = this.func_82846_b(p_75144_4_, p_75144_1_);
          if (var8 != null) {
            int var12 = var8.field_77993_c;
            var5 = var8.func_77946_l();
            if (var7 != null
                && var7.func_75211_c() != null
                && var7.func_75211_c().field_77993_c == var12) {
              this.func_75133_b(p_75144_1_, p_75144_2_, true, p_75144_4_);
            }
          }
        }
      } else {
        if (p_75144_1_ < 0) {
          return null;
        }

        var7 = (Slot) this.field_75151_b.get(p_75144_1_);
        if (var7 != null) {
          var8 = var7.func_75211_c();
          ItemStack var13 = var6.func_70445_o();
          if (var8 != null) {
            var5 = var8.func_77946_l();
          }

          if (var8 == null) {
            if (var13 != null && var7.func_75214_a(var13)) {
              var10 = p_75144_2_ == 0 ? var13.field_77994_a : 1;
              if (var10 > var7.func_75219_a()) {
                var10 = var7.func_75219_a();
              }

              var7.func_75215_d(var13.func_77979_a(var10));
              if (var13.field_77994_a == 0) {
                var6.func_70437_b((ItemStack) null);
              }
            }
          } else if (var7.func_82869_a(p_75144_4_)) {
            if (var13 == null) {
              var10 = p_75144_2_ == 0 ? var8.field_77994_a : (var8.field_77994_a + 1) / 2;
              var11 = var7.func_75209_a(var10);
              var6.func_70437_b(var11);
              if (var8.field_77994_a == 0) {
                var7.func_75215_d((ItemStack) null);
              }

              var7.func_82870_a(p_75144_4_, var6.func_70445_o());
            } else if (var7.func_75214_a(var13)) {
              if (var8.field_77993_c == var13.field_77993_c
                  && (!var8.func_77981_g() || var8.func_77960_j() == var13.func_77960_j())
                  && ItemStack.func_77970_a(var8, var13)) {
                var10 = p_75144_2_ == 0 ? var13.field_77994_a : 1;
                if (var10 > var7.func_75219_a() - var8.field_77994_a) {
                  var10 = var7.func_75219_a() - var8.field_77994_a;
                }

                if (var10 > var13.func_77976_d() - var8.field_77994_a) {
                  var10 = var13.func_77976_d() - var8.field_77994_a;
                }

                var13.func_77979_a(var10);
                if (var13.field_77994_a == 0) {
                  var6.func_70437_b((ItemStack) null);
                }

                var8.field_77994_a += var10;
              } else if (var13.field_77994_a <= var7.func_75219_a()) {
                var7.func_75215_d(var13);
                var6.func_70437_b(var8);
              }
            } else if (var8.field_77993_c == var13.field_77993_c
                && var13.func_77976_d() > 1
                && (!var8.func_77981_g() || var8.func_77960_j() == var13.func_77960_j())
                && ItemStack.func_77970_a(var8, var13)) {
              var10 = var8.field_77994_a;
              if (var10 > 0 && var10 + var13.field_77994_a <= var13.func_77976_d()) {
                var13.field_77994_a += var10;
                var8 = var7.func_75209_a(var10);
                if (var8.field_77994_a == 0) {
                  var7.func_75215_d((ItemStack) null);
                }

                var7.func_82870_a(p_75144_4_, var6.func_70445_o());
              }
            }
          }

          var7.func_75218_e();
        }
      }
    } else if (p_75144_3_ == 2 && p_75144_2_ >= 0 && p_75144_2_ < 9) {
      var7 = (Slot) this.field_75151_b.get(p_75144_1_);
      if (var7.func_82869_a(p_75144_4_)) {
        var8 = var6.func_70301_a(p_75144_2_);
        boolean var9 = var8 == null || var7.field_75224_c == var6 && var7.func_75214_a(var8);
        var10 = -1;
        if (!var9) {
          var10 = var6.func_70447_i();
          var9 |= var10 > -1;
        }

        if (var7.func_75216_d() && var9) {
          var11 = var7.func_75211_c();
          var6.func_70299_a(p_75144_2_, var11);
          if ((var7.field_75224_c != var6 || !var7.func_75214_a(var8)) && var8 != null) {
            if (var10 > -1) {
              var6.func_70441_a(var8);
              var7.func_75215_d((ItemStack) null);
              var7.func_82870_a(p_75144_4_, var11);
            }
          } else {
            var7.func_75215_d(var8);
            var7.func_82870_a(p_75144_4_, var11);
          }
        } else if (!var7.func_75216_d() && var8 != null && var7.func_75214_a(var8)) {
          var6.func_70299_a(p_75144_2_, (ItemStack) null);
          var7.func_75215_d(var8);
        }
      }
    } else if (p_75144_3_ == 3
        && p_75144_4_.field_71075_bZ.field_75098_d
        && var6.func_70445_o() == null
        && p_75144_1_ >= 0) {
      var7 = (Slot) this.field_75151_b.get(p_75144_1_);
      if (var7 != null && var7.func_75216_d()) {
        var8 = var7.func_75211_c().func_77946_l();
        var8.field_77994_a = var8.func_77976_d();
        var6.func_70437_b(var8);
      }
    }

    return var5;
  }