public void h() {
    boolean flag = this.burnTime > 0;
    boolean flag1 = false;

    if (this.burnTime > 0) {
      --this.burnTime;
    }

    if (!this.world.isStatic) {
      if (this.burnTime == 0 && this.canBurn()) {
        this.ticksForCurrentFuel = this.burnTime = fuelTime(this.items[1]);
        if (this.burnTime > 0) {
          flag1 = true;
          if (this.items[1] != null) {
            --this.items[1].count;
            if (this.items[1].count == 0) {
              Item item = this.items[1].getItem().t();

              this.items[1] = item != null ? new ItemStack(item) : null;
            }
          }
        }
      }

      if (this.isBurning() && this.canBurn()) {
        ++this.cookTime;
        if (this.cookTime == 200) {
          this.cookTime = 0;
          this.burn();
          flag1 = true;
        }
      } else {
        this.cookTime = 0;
      }

      if (flag != this.burnTime > 0) {
        flag1 = true;
        BlockFurnace.a(this.burnTime > 0, this.world, this.x, this.y, this.z);
      }
    }

    if (flag1) {
      this.update();
    }
  }
示例#2
0
  public void f() {
    boolean flag = e > 0;
    boolean flag1 = false;

    if (e > 0) {
      e--;
    }
    if (!a.z) {
      if (e == 0 && i()) {
        f = e = a(h[1]);
        if (e > 0) {
          flag1 = true;
          if (h[1] != null) {
            h[1].a--;
            if (h[1].a == 0) {
              h[1] = null;
            }
          }
        }
      }
      if (e() && i()) {
        g++;
        if (g == 200) {
          g = 0;
          h();
          flag1 = true;
        }
      } else {
        g = 0;
      }
      if (flag != (e > 0)) {
        flag1 = true;
        BlockFurnace.a(e > 0, a, b, c, d);
      }
    }
    if (flag1) {
      d();
    }
  }
 public void updateEntity() {
   boolean flag = furnaceBurnTime > 0;
   boolean flag1 = false;
   if (furnaceBurnTime > 0) {
     furnaceBurnTime--;
   }
   if (!worldObj.singleplayerWorld) {
     if (furnaceBurnTime == 0 && canSmelt()) {
       currentItemBurnTime = furnaceBurnTime = getItemBurnTime(furnaceItemStacks[1]);
       if (furnaceBurnTime > 0) {
         flag1 = true;
         if (furnaceItemStacks[1] != null) {
           furnaceItemStacks[1].stackSize--;
           if (furnaceItemStacks[1].stackSize == 0) {
             furnaceItemStacks[1] = null;
           }
         }
       }
     }
     if (isBurning() && canSmelt()) {
       furnaceCookTime++;
       if (furnaceCookTime == 200) {
         furnaceCookTime = 0;
         smeltItem();
         flag1 = true;
       }
     } else {
       furnaceCookTime = 0;
     }
     if (flag != (furnaceBurnTime > 0)) {
       flag1 = true;
       BlockFurnace.updateFurnaceBlockState(furnaceBurnTime > 0, worldObj, xCoord, yCoord, zCoord);
     }
   }
   if (flag1) {
     onInventoryChanged();
   }
 }