Package org.mattrick.enbeet
Class NBTCompound
java.lang.Object
org.mattrick.enbeet.NBTCompound
A Minecraft NBT Compound.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new NBTCompound.NBTCompound(String name)Create a new NBTCompound with the given name in its root. -
Method Summary
Modifier and TypeMethodDescriptiondata()Get the backing Map of the NBTCompound.boolean<T> Optional<T>Get the value of the given type at the given path.Get the value at the given path.Get a Byte at the given path.Optional<byte[]>getByteArray(String... path)Get a byte[] at the given path.getCompound(String... path)Get a NBTCompound at the given path.Get a Double at the given path.Get a Float at the given path.Get a Integer at the given path.Optional<int[]>getIntArray(String... path)Get a int[] at the given path.Get a NBTList at the given path.Get a Long at the given path.Optional<long[]>getLongArray(String... path)Get a long[] at the given path.getName()Get the name of this NBTCompound ("named tag"), if it exists.Get a Short at the given path.Get a String at the given path.Optional<int[]>getVarIntArray(String... path)Get a int[] (which was coded as a varint array) at the given path.inthashCode()voidSet a value in the NBTCompound.voidSet the name of this NBTCompound ("named tag").toString()
-
Constructor Details
-
NBTCompound
public NBTCompound()Create a new NBTCompound. -
NBTCompound
Create a new NBTCompound with the given name in its root.
-
-
Method Details
-
getName
Get the name of this NBTCompound ("named tag"), if it exists.- Returns:
- An Optional, containing the name of this tag if it exists.
-
setName
Set the name of this NBTCompound ("named tag").- Parameters:
name- Set the name of this NBTCompound.
-
set
Set a value in the NBTCompound.- Parameters:
value- The value to set.path- The path to set to the value.
-
get
Get the value at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the value at the path if it exists.
-
get
Get the value of the given type at the given path.- Type Parameters:
T- The type of the object at the path.- Parameters:
type- The type to get.path- The path to get.- Returns:
- An Optional containing the value at the path if it exists and matches the provided type.
-
getByte
Get a Byte at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Byte at the path if it exists.
-
getShort
Get a Short at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Short at the path if it exists.
-
getInt
Get a Integer at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Integer at the path if it exists.
-
getLong
Get a Long at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Long at the path if it exists.
-
getFloat
Get a Float at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Float at the path if it exists.
-
getDouble
Get a Double at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the Double at the path if it exists.
-
getByteArray
Get a byte[] at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the byte[] at the path if it exists.
-
getString
Get a String at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the String at the path if it exists.
-
getList
Get a NBTList at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the NBTList at the path if it exists.
-
getCompound
Get a NBTCompound at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the NBTCompound at the path if it exists.
-
getIntArray
Get a int[] at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the int[] at the path if it exists.
-
getLongArray
Get a long[] at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the long[] at the path if it exists.
-
getVarIntArray
Get a int[] (which was coded as a varint array) at the given path.- Parameters:
path- The path to get.- Returns:
- An Optional containing the varint array at the path if it exists.
-
data
Get the backing Map of the NBTCompound.- Returns:
- The backing Map.
-
toString
-
equals
-
hashCode
public int hashCode()
-