public void updateEntity() { super.updateEntity(); boolean flag = isBurning(); boolean flag1 = false; if (fuel <= 0 && canOperate()) { fuel = fuelGague = getFuelValueFor(inventory[1]); if (fuel > 0) { if (inventory[1].getItem().hasContainerItem()) { inventory[1] = new ItemStack(inventory[1].getItem().getContainerItem()); } else { inventory[1].stackSize--; } if (inventory[1].stackSize <= 0) { inventory[1] = null; } flag1 = true; } } if (isBurning() && canOperate()) { progress++; if (progress >= 200) { progress = 0; operate(); flag1 = true; } } else { progress = 0; } if (fuel > 0) { fuel--; } if (flag != isBurning()) { setActive(isBurning()); flag1 = true; } if (flag1) { onInventoryChanged(); } }
public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); nbttagcompound.setShort("fuel", fuel); nbttagcompound.setShort("fuelGague", fuelGague); }
public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); fuel = nbttagcompound.getShort("fuel"); fuelGague = nbttagcompound.getShort("fuelGague"); }