    001package net.minecraft.tileentity;
    002
    003import net.minecraft.block.BlockDaylightDetector;
    004
    005public class TileEntityDaylightDetector extends TileEntity
    006{
    007    /**
    008     * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count
    009     * ticks and creates a new spawn inside its implementation.
    010     */
    011    public void updateEntity()
    012    {
    013        if (this.worldObj != null && !this.worldObj.isRemote && this.worldObj.getTotalWorldTime() % 20L == 0L)
    014        {
    015            this.blockType = this.getBlockType();
    016
    017            if (this.blockType != null && this.blockType instanceof BlockDaylightDetector)
    018            {
    019                ((BlockDaylightDetector)this.blockType).func_94444_j_(this.worldObj, this.xCoord, this.yCoord, this.zCoord);
    020            }
    021        }
    022    }
    023}