package net.minecraft.nbt;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class NBTTagString extends NBTBase
{
	private String data;
	private static final String __OBFID = "CL_00001228";

	public NBTTagString()
	{
		this.data = "";
	}

	public NBTTagString(String par1Str)
	{
		this.data = par1Str;

		if (par1Str == null)
		{
			throw new IllegalArgumentException("Empty string not allowed");
		}
	}

	void write(DataOutput par1DataOutput) throws IOException
	{
		par1DataOutput.writeUTF(this.data);
	}

	void load(DataInput par1DataInput, int par2) throws IOException
	{
		this.data = par1DataInput.readUTF();
	}

	public byte getId()
	{
		return (byte)8;
	}

	public String toString()
	{
		return "\"" + this.data + "\"";
	}

	public NBTBase copy()
	{
		return new NBTTagString(this.data);
	}

	public boolean equals(Object par1Obj)
	{
		if (!super.equals(par1Obj))
		{
			return false;
		}
		else
		{
			NBTTagString nbttagstring = (NBTTagString)par1Obj;
			return this.data == null && nbttagstring.data == null || this.data != null && this.data.equals(nbttagstring.data);
		}
	}

	public int hashCode()
	{
		return super.hashCode() ^ this.data.hashCode();
	}

	public String func_150285_a_()
	{
		return this.data;
	}
}