public void updateAnimation() {
    if (this.listAnimationTuples != null) {
      Tuple tuple = (Tuple) this.listAnimationTuples.get(this.frameCounter);
      ++this.tickCounter;

      if (this.tickCounter >= ((Integer) tuple.getSecond()).intValue()) {
        int i = ((Integer) tuple.getFirst()).intValue();
        this.frameCounter = (this.frameCounter + 1) % this.listAnimationTuples.size();
        this.tickCounter = 0;
        tuple = (Tuple) this.listAnimationTuples.get(this.frameCounter);
        int j = ((Integer) tuple.getFirst()).intValue();

        if (i != j && j >= 0 && j < this.textureList.size()) {
          this.textureSheet.copyFrom(
              this.originX,
              this.originY,
              (Texture) this.textureList.get(j),
              false); // FML: We rotate the textures in init.
        }
      }
    } else {
      int k = this.frameCounter;
      this.frameCounter = (this.frameCounter + 1) % this.textureList.size();

      if (k != this.frameCounter) {
        this.textureSheet.copyFrom(
            this.originX,
            this.originY,
            (Texture) this.textureList.get(this.frameCounter),
            false); // FML: We rotate the textures in init.
      }
    }
  }
Esempio n. 2
0
  private boolean absorbWater(World worldIn, BlockPos p_176312_2_) {
    LinkedList var3 = Lists.newLinkedList();
    ArrayList var4 = Lists.newArrayList();
    var3.add(new Tuple(p_176312_2_, Integer.valueOf(0)));
    int var5 = 0;
    BlockPos var7;

    while (!var3.isEmpty()) {
      Tuple var6 = (Tuple) var3.poll();
      var7 = (BlockPos) var6.getFirst();
      int var8 = ((Integer) var6.getSecond()).intValue();
      EnumFacing[] var9 = EnumFacing.values();
      int var10 = var9.length;

      for (int var11 = 0; var11 < var10; ++var11) {
        EnumFacing var12 = var9[var11];
        BlockPos var13 = var7.offset(var12);

        if (worldIn.getBlockState(var13).getBlock().getMaterial() == Material.water) {
          worldIn.setBlockState(var13, Blocks.air.getDefaultState(), 2);
          var4.add(var13);
          ++var5;

          if (var8 < 6) {
            var3.add(new Tuple(var13, Integer.valueOf(var8 + 1)));
          }
        }
      }

      if (var5 > 64) {
        break;
      }
    }

    Iterator var14 = var4.iterator();

    while (var14.hasNext()) {
      var7 = (BlockPos) var14.next();
      worldIn.notifyNeighborsOfStateChange(var7, Blocks.air);
    }

    return var5 > 0;
  }
Esempio n. 3
0
 private static int getRandomCountForBlacksmithItem(int par0, Random par1Random) {
   Tuple tuple = (Tuple) blacksmithSellingList.get(Integer.valueOf(par0));
   return tuple == null
       ? 1
       : (((Integer) tuple.getFirst()).intValue() >= ((Integer) tuple.getSecond()).intValue()
           ? ((Integer) tuple.getFirst()).intValue()
           : ((Integer) tuple.getFirst()).intValue()
               + par1Random.nextInt(
                   ((Integer) tuple.getSecond()).intValue()
                       - ((Integer) tuple.getFirst()).intValue()));
 }
Esempio n. 4
0
 private static int func_146090_c(Item p_146090_0_, Random p_146090_1_) {
   Tuple var2 = (Tuple) field_70960_bC.get(p_146090_0_);
   return var2 == null
       ? 1
       : (((Integer) var2.func_76341_a()).intValue() >= ((Integer) var2.func_76340_b()).intValue()
           ? ((Integer) var2.func_76341_a()).intValue()
           : ((Integer) var2.func_76341_a()).intValue()
               + p_146090_1_.nextInt(
                   ((Integer) var2.func_76340_b()).intValue()
                       - ((Integer) var2.func_76341_a()).intValue()));
 }