コード例 #1
0
 public void func_85106_a(
     World p_85106_1_, int p_85106_2_, int p_85106_3_, int p_85106_4_, ItemStack p_85106_5_) {
   if (!p_85106_1_.field_72995_K) {
     TileEntityRecordPlayer var6 =
         (TileEntityRecordPlayer) p_85106_1_.func_72796_p(p_85106_2_, p_85106_3_, p_85106_4_);
     if (var6 != null) {
       var6.func_96098_a(p_85106_5_.func_77946_l());
       p_85106_1_.func_72921_c(p_85106_2_, p_85106_3_, p_85106_4_, 1, 2);
     }
   }
 }
コード例 #2
0
ファイル: Container.java プロジェクト: pedroreisuft/minecraft
  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);
        }
      }
    }
  }
コード例 #3
0
 public void func_72276_j_(World p_72276_1_, int p_72276_2_, int p_72276_3_, int p_72276_4_) {
   if (!p_72276_1_.field_72995_K) {
     TileEntityRecordPlayer var5 =
         (TileEntityRecordPlayer) p_72276_1_.func_72796_p(p_72276_2_, p_72276_3_, p_72276_4_);
     if (var5 != null) {
       ItemStack var6 = var5.func_96097_a();
       if (var6 != null) {
         p_72276_1_.func_72926_e(1005, p_72276_2_, p_72276_3_, p_72276_4_, 0);
         p_72276_1_.func_72934_a((String) null, p_72276_2_, p_72276_3_, p_72276_4_);
         var5.func_96098_a((ItemStack) null);
         p_72276_1_.func_72921_c(p_72276_2_, p_72276_3_, p_72276_4_, 0, 2);
         float var7 = 0.7F;
         double var8 =
             (double) (p_72276_1_.field_73012_v.nextFloat() * var7)
                 + (double) (1.0F - var7) * 0.5D;
         double var10 =
             (double) (p_72276_1_.field_73012_v.nextFloat() * var7)
                 + (double) (1.0F - var7) * 0.2D
                 + 0.6D;
         double var12 =
             (double) (p_72276_1_.field_73012_v.nextFloat() * var7)
                 + (double) (1.0F - var7) * 0.5D;
         ItemStack var14 = var6.func_77946_l();
         EntityItem var15 =
             new EntityItem(
                 p_72276_1_,
                 (double) p_72276_2_ + var8,
                 (double) p_72276_3_ + var10,
                 (double) p_72276_4_ + var12,
                 var14);
         var15.field_70293_c = 10;
         p_72276_1_.func_72838_d(var15);
       }
     }
   }
 }
コード例 #4
0
ファイル: Container.java プロジェクト: pedroreisuft/minecraft
  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;
  }
コード例 #5
0
ファイル: Container.java プロジェクト: pedroreisuft/minecraft
  protected boolean func_75135_a(
      ItemStack p_75135_1_, int p_75135_2_, int p_75135_3_, boolean p_75135_4_) {
    boolean var5 = false;
    int var6 = p_75135_2_;
    if (p_75135_4_) {
      var6 = p_75135_3_ - 1;
    }

    Slot var7;
    ItemStack var8;
    if (p_75135_1_.func_77985_e()) {
      while (p_75135_1_.field_77994_a > 0
          && (!p_75135_4_ && var6 < p_75135_3_ || p_75135_4_ && var6 >= p_75135_2_)) {
        var7 = (Slot) this.field_75151_b.get(var6);
        var8 = var7.func_75211_c();
        if (var8 != null
            && var8.field_77993_c == p_75135_1_.field_77993_c
            && (!p_75135_1_.func_77981_g() || p_75135_1_.func_77960_j() == var8.func_77960_j())
            && ItemStack.func_77970_a(p_75135_1_, var8)) {
          int var9 = var8.field_77994_a + p_75135_1_.field_77994_a;
          if (var9 <= p_75135_1_.func_77976_d()) {
            p_75135_1_.field_77994_a = 0;
            var8.field_77994_a = var9;
            var7.func_75218_e();
            var5 = true;
          } else if (var8.field_77994_a < p_75135_1_.func_77976_d()) {
            p_75135_1_.field_77994_a -= p_75135_1_.func_77976_d() - var8.field_77994_a;
            var8.field_77994_a = p_75135_1_.func_77976_d();
            var7.func_75218_e();
            var5 = true;
          }
        }

        if (p_75135_4_) {
          --var6;
        } else {
          ++var6;
        }
      }
    }

    if (p_75135_1_.field_77994_a > 0) {
      if (p_75135_4_) {
        var6 = p_75135_3_ - 1;
      } else {
        var6 = p_75135_2_;
      }

      while (!p_75135_4_ && var6 < p_75135_3_ || p_75135_4_ && var6 >= p_75135_2_) {
        var7 = (Slot) this.field_75151_b.get(var6);
        var8 = var7.func_75211_c();
        if (var8 == null) {
          var7.func_75215_d(p_75135_1_.func_77946_l());
          var7.func_75218_e();
          p_75135_1_.field_77994_a = 0;
          var5 = true;
          break;
        }

        if (p_75135_4_) {
          --var6;
        } else {
          ++var6;
        }
      }
    }

    return var5;
  }