Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateEntity()
- {
- // updates side values
- this.updateMachineSideValues();
- this.updateCondenserValues();
- // update block
- if (worldObj.isRemote)
- {
- this.updateBlock();
- }
- // sets the flags
- boolean flag = this.condenserBurnTime > 0;
- boolean flag1 = false;
- // updates the fuel burn time
- if (this.condenserBurnTime > 0)
- {
- this.condenserBurnTime -= Double.parseDouble(FormatDecimals.hunds.format(this.cookTick * this.getSpeed()));
- this.condenserBurnTime = Double.parseDouble(FormatDecimals.hunds.format(this.condenserBurnTime));
- }
- else
- {
- this.condenserBurnTime = 0;
- }
- // When on server...
- if (!this.worldObj.isRemote)
- {
- // If it can condense...
- if (this.canSmelt())
- {
- // And it is not burning...
- if (!this.isBurning())
- {
- // sets the fuel burn time start
- this.currentItemBurnTime = this.condenserBurnTime = GlobalValues.getBurnTime(this.itemslots[1]) * this.getSpeed();
- if (this.isBurning())
- {
- flag1 = true;
- if (this.itemslots[1] != null)
- {
- // subtracts 1 from the fuel
- this.setInventorySlotContents(1, new ItemStack(this.itemslots[1].getItem(), this.itemslots[1].stackSize - 1, this.itemslots[1].getItemDamage()));
- // sets the fuel to null if stacksize returns 0.
- if (this.itemslots[1].stackSize == 0)
- {
- this.itemslots[1] = null;
- }
- }
- }
- }
- // And it is burning...
- if (this.isBurning())
- {
- // Updates the smelt progress time
- if (this.condenserCookTime < GlobalValues.getSmeltTime(itemslots[0], RecipesCarbonCondenser.InputSize(itemslots[0])) * this.getSpeed())
- {
- this.condenserCookTime += Double.parseDouble(FormatDecimals.hunds.format(this.cookTick * this.getSpeed()));
- this.condenserCookTime = Double.parseDouble(FormatDecimals.hunds.format(this.condenserCookTime));
- }
- // If the cook time goes past the smelt time, reset time to
- // 0 and smelt item.
- if (this.condenserCookTime >= GlobalValues.getSmeltTime(itemslots[0], RecipesCarbonCondenser.InputSize(itemslots[0])) * this.getSpeed())
- {
- this.condenserCookTime = 0;
- this.smeltItem();
- flag1 = true;
- }
- }
- }
- // while burning, update block to look burning.
- if (flag != this.condenserBurnTime > 0)
- {
- flag1 = true;
- CarbonCondenser.updateBlockState(this.condenserBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
- }
- }
- if (this.getStackInSlot(0) == null)
- {
- this.condenserCookTime = 0;
- }
- if (flag1)
- {
- this.markDirty();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment