Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void update()
- {
- boolean flag = this.isBurning();
- boolean flag1 = false;
- if(this.isBurning())
- --this.burnTime;
- if(!this.world.isRemote)
- {
- ItemStack itemStack = (ItemStack)this.inventory.get(2);
- if(this.isBurning() || !itemStack.isEmpty() && !((((ItemStack)this.inventory.get(0)).isEmpty()) || ((ItemStack)this.inventory.get(1)).isEmpty()))
- {
- if(!this.isBurning() && this.canSmelt())
- {
- this.burnTime = getItemBurnTime(itemStack);
- this.currentBurnTime = this.burnTime;
- if(this.isBurning())
- {
- flag1 = true;
- if(!itemStack.isEmpty())
- {
- Item item = itemStack.getItem();
- itemStack.shrink(1);
- if(itemStack.isEmpty())
- {
- ItemStack item1 = item.getContainerItem(itemStack);
- this.inventory.set(2, item1);
- }
- }
- }
- }
- if(this.isBurning() && this.canSmelt())
- {
- ++this.cookTime;
- if(this.cookTime == this.totalCookTime)
- {
- this.cookTime = 0;
- this.totalCookTime = this.getCookTime((ItemStack)this.inventory.get(0), (ItemStack)this.inventory.get(1));
- this.smeltItem();
- flag1 = true;
- }
- } else
- this.cookTime = 0;
- } else if(!this.isBurning() && this.cookTime > 0)
- this.cookTime = MathHelper.clamp(this.cookTime - 2, 0, this.totalCookTime);
- if(flag != this.isBurning())
- {
- flag1 = true;
- DualFurance.setState(this.isBurning(), this.world, this.pos);
- }
- }
- if(flag1)
- this.markDirty();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement