tterrag1098

Untitled

Nov 3rd, 2013
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. public void updateEntity()
  2.     {
  3.         super.updateEntity();
  4.  
  5.         if (worldObj.getLightBrightness(xCoord, yCoord, zCoord) < 0.8F)
  6.             worldObj.updateAllLightTypes(xCoord, yCoord, zCoord);
  7.  
  8.         if (!worldObj.isRemote)
  9.         {
  10.             currentSunLight = worldObj.getLightBrightness(xCoord, yCoord + 1, zCoord) * 15;
  11.             this.worldTime = worldObj.getWorldTime();
  12.  
  13.             if (prevWorldTime == -1)
  14.                 prevWorldTime = worldTime;
  15.             if ((worldTime) % 20 == 0 && worldTime > prevWorldTime)
  16.             {
  17.                 setEnergyStored((int) (getEnergyStored() + currentSunLight / 1.5));
  18.                 prevWorldTime = worldTime;
  19.             }
  20.  
  21.             if ((inventory[0] != null && getItemBurnTime(inventory[0]) > 0)  || isBurning)
  22.             {
  23.                 if (isBurning)
  24.                 {
  25.                     burnTimeLeft -= 40;
  26.                     if (worldObj.getWorldTime() % 20 == 10)
  27.                     setEnergyStored(getEnergyStored() + 200);
  28.                 }
  29.                 else if (inventory[0].stackSize >= 0)
  30.                 {
  31.                     isBurning = true;
  32.                     currentItemBurnTime = getItemBurnTime(inventory[0]);
  33.                     burnTimeLeft = getItemBurnTime(inventory[0]);
  34.                     if (inventory[0].stackSize > 1)
  35.                         inventory[0].stackSize--;
  36.                     else
  37.                         inventory[0] = null;
  38.                 }
  39.                 if (burnTimeLeft <= 0)
  40.                     isBurning = false;
  41.                
  42.             }
  43.         }
  44.         if (energyStored >= 1000)
  45.         {
  46.             fabricateOutput();
  47.             setEnergyStored(getEnergyStored() - 1000);
  48.         }
  49.     }
Advertisement
Add Comment
Please, Sign In to add comment