    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    public class TileEntitySkull extends TileEntity
    007    {
    008        private int field_82123_a;
    009        private int field_82121_b;
    010        private String field_82122_c = "";
    011
    012        /**
    013         * Writes a tile entity to NBT.
    014         */
    015        public void writeToNBT(NBTTagCompound par1NBTTagCompound)
    016        {
    017            super.writeToNBT(par1NBTTagCompound);
    018            par1NBTTagCompound.setByte("SkullType", (byte)(this.field_82123_a & 255));
    019            par1NBTTagCompound.setByte("Rot", (byte)(this.field_82121_b & 255));
    020            par1NBTTagCompound.setString("ExtraType", this.field_82122_c);
    021        }
    022
    023        /**
    024         * Reads a tile entity from NBT.
    025         */
    026        public void readFromNBT(NBTTagCompound par1NBTTagCompound)
    027        {
    028            super.readFromNBT(par1NBTTagCompound);
    029            this.field_82123_a = par1NBTTagCompound.getByte("SkullType");
    030            this.field_82121_b = par1NBTTagCompound.getByte("Rot");
    031
    032            if (par1NBTTagCompound.hasKey("ExtraType"))
    033            {
    034                this.field_82122_c = par1NBTTagCompound.getString("ExtraType");
    035            }
    036        }
    037
    038        /**
    039         * Overriden in a sign to provide the text.
    040         */
    041        public Packet getDescriptionPacket()
    042        {
    043            NBTTagCompound var1 = new NBTTagCompound();
    044            this.writeToNBT(var1);
    045            return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, var1);
    046        }
    047
    048        public void func_82118_a(int par1, String par2Str)
    049        {
    050            this.field_82123_a = par1;
    051            this.field_82122_c = par2Str;
    052        }
    053
    054        public int func_82117_a()
    055        {
    056            return this.field_82123_a;
    057        }
    058
    059        public void func_82116_a(int par1)
    060        {
    061            this.field_82121_b = par1;
    062        }
    063
    064        @SideOnly(Side.CLIENT)
    065        public int func_82119_b()
    066        {
    067            return this.field_82121_b;
    068        }
    069
    070        @SideOnly(Side.CLIENT)
    071        public String func_82120_c()
    072        {
    073            return this.field_82122_c;
    074        }
    075    }