Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateEntity()
- {
- super.updateEntity();
- if (worldObj.getLightBrightness(xCoord, yCoord, zCoord) < 0.8F)
- worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
- if (!worldObj.isRemote)
- {
- currentSunLight = worldObj.getLightBrightness(xCoord, yCoord + 1, zCoord) * 15;
- this.worldTime = worldObj.getWorldTime();
- if (prevWorldTime == -1)
- prevWorldTime = worldTime;
- if ((worldTime) % 20 == 0 && worldTime > prevWorldTime)
- {
- setEnergyStored((int) (getEnergyStored() + currentSunLight / 1.5));
- prevWorldTime = worldTime;
- }
- if ((inventory[0] != null && getItemBurnTime(inventory[0]) > 0) || isBurning)
- {
- if (isBurning)
- {
- burnTimeLeft -= 40;
- if (worldObj.getWorldTime() % 20 == 10)
- setEnergyStored(getEnergyStored() + 200);
- }
- else if (inventory[0].stackSize >= 0)
- {
- isBurning = true;
- currentItemBurnTime = getItemBurnTime(inventory[0]);
- burnTimeLeft = getItemBurnTime(inventory[0]);
- if (inventory[0].stackSize > 1)
- inventory[0].stackSize--;
- else
- inventory[0] = null;
- }
- if (burnTimeLeft <= 0)
- isBurning = false;
- }
- }
- if (energyStored >= 1000)
- {
- fabricateOutput();
- setEnergyStored(getEnergyStored() - 1000);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment