package net.minecraft.nbt;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import net.minecraft.util.MathHelper;

public class NBTTagFloat extends NBTBase.NBTPrimitive
{
	private float data;
	private static final String __OBFID = "CL_00001220";

	NBTTagFloat() {}

	public NBTTagFloat(float p_i45131_1_)
	{
		this.data = p_i45131_1_;
	}

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

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

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

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

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

	public boolean equals(Object par1Obj)
	{
		if (super.equals(par1Obj))
		{
			NBTTagFloat nbttagfloat = (NBTTagFloat)par1Obj;
			return this.data == nbttagfloat.data;
		}
		else
		{
			return false;
		}
	}

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

	public long func_150291_c()
	{
		return (long)this.data;
	}

	public int func_150287_d()
	{
		return MathHelper.floor_float(this.data);
	}

	public short func_150289_e()
	{
		return (short)(MathHelper.floor_float(this.data) & 65535);
	}

	public byte func_150290_f()
	{
		return (byte)(MathHelper.floor_float(this.data) & 255);
	}

	public double func_150286_g()
	{
		return (double)this.data;
	}

	public float func_150288_h()
	{
		return this.data;
	}
}