package common.tileentity;

import common.nbt.NBTTagCompound;
import common.network.Packet;
import common.packet.S35PacketUpdateTileEntity;

public class TileEntitySkull extends TileEntity
{
    private int skullRotation;
//    private String user = null;

    public void writeToNBT(NBTTagCompound compound)
    {
        super.writeToNBT(compound);
        compound.setByte("Rot", (byte)(this.skullRotation & 255));
//        if(this.user != null)
//            compound.setString("Owner", this.user);
    }

    public void readFromNBT(NBTTagCompound compound)
    {
        super.readFromNBT(compound);
        this.skullRotation = compound.getByte("Rot");
//        if(compound.hasKey("Owner", 8))
//            this.user = compound.getString("Owner");
    }

//    public String getUser()
//    {
//        return this.user;
//    }

    /**
     * Allows for a specialized description packet to be created. This is often used to sync tile entity data from the
     * server to the client easily. For example this is used by signs to synchronise the text to be displayed.
     */
    public Packet getDescriptionPacket()
    {
        return new S35PacketUpdateTileEntity(this);
    }

//    public void setUser(String user)
//    {
//        this.user = user;
//        this.markDirty();
//    }

    public int getSkullRotation()
    {
        return this.skullRotation;
    }

    public void setSkullRotation(int rotation)
    {
        this.skullRotation = rotation;
    }
    
    public int getColor() {
    	return 0x00ff00;
    }
}
