package common.tileentity;

import common.block.BlockDaylightDetector;
import common.world.AWorldServer;

public class TileEntityDaylightDetector extends TileEntity implements ITickable
{
    /**
     * Like the old updateEntity(), except more generic.
     */
    public void update()
    {
        if (this.worldObj != null && !this.worldObj.client && ((AWorldServer)this.worldObj).getTime() % 20L == 0L)
        {
            this.blockType = this.getBlockType();

            if (this.blockType instanceof BlockDaylightDetector)
            {
                ((BlockDaylightDetector)this.blockType).updatePower((AWorldServer)this.worldObj, this.pos);
            }
        }
    }
    
    public int getColor() {
    	return 0xffffaf;
    }
}
