Advertisement
HalestormXV

Untitled

Aug 27th, 2017
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.20 KB | None | 0 0
  1.     @Override
  2.     public void update()
  3.     {
  4.         boolean flag = this.isBurning();
  5.         boolean flag1 = false;
  6.  
  7.         if(this.isBurning())
  8.             --this.burnTime;
  9.  
  10.         if(!this.world.isRemote)
  11.         {
  12.             ItemStack itemStack = (ItemStack)this.inventory.get(2);
  13.  
  14.             if(this.isBurning() || !itemStack.isEmpty() && !((((ItemStack)this.inventory.get(0)).isEmpty()) || ((ItemStack)this.inventory.get(1)).isEmpty()))
  15.             {
  16.                 if(!this.isBurning() && this.canSmelt())
  17.                 {
  18.                     this.burnTime = getItemBurnTime(itemStack);
  19.                     this.currentBurnTime = this.burnTime;
  20.  
  21.                     if(this.isBurning())
  22.                     {
  23.                         flag1 = true;
  24.  
  25.                         if(!itemStack.isEmpty())
  26.                         {
  27.                             Item item = itemStack.getItem();
  28.                             itemStack.shrink(1);
  29.                             if(itemStack.isEmpty())
  30.                             {
  31.                                 ItemStack item1 = item.getContainerItem(itemStack);
  32.                                 this.inventory.set(2, item1);
  33.                             }
  34.                         }
  35.                     }
  36.                 }
  37.                 if(this.isBurning() && this.canSmelt())
  38.                 {
  39.                     ++this.cookTime;
  40.  
  41.                     if(this.cookTime == this.totalCookTime)
  42.                     {
  43.                         this.cookTime = 0;
  44.                         this.totalCookTime = this.getCookTime((ItemStack)this.inventory.get(0), (ItemStack)this.inventory.get(1));
  45.                         this.smeltItem();
  46.                         flag1 = true;
  47.                     }
  48.                 } else
  49.                     this.cookTime = 0;
  50.             } else if(!this.isBurning() && this.cookTime > 0)
  51.                 this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
  52.             if(flag != this.isBurning())
  53.             {
  54.                 flag1 = true;
  55.                 DualFurance.setState(this.isBurning(), this.world, this.pos);
  56.  
  57.             }
  58.         }
  59.         if(flag1)
  60.         this.markDirty();
  61.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement