Interface NbtBase<TType>
- Type Parameters:
TType- - type of the value that is stored.
- All Superinterfaces:
ClonableWrapper
- All Known Subinterfaces:
NbtCompound,NbtList<TType>,NbtWrapper<TType>
Represents a generic container for an NBT element.
Use NbtFactory to load or create an instance.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaccept(NbtVisitor visitor) Accepts a NBT visitor.Clone the current NBT tag.default ObjectgetName()Retrieve the name of this NBT tag.getType()Retrieve the type of this NBT element.getValue()Retrieve the value of this NBT tag.voidSet the name of this NBT tag.voidSet the value of this NBT tag.
-
Method Details
-
accept
Accepts a NBT visitor.- Parameters:
visitor- - the hierarchical NBT visitor.- Returns:
- TRUE if the parent should continue processing children at the current level, FALSE otherwise.
-
getType
NbtType getType()Retrieve the type of this NBT element.- Returns:
- The type of this NBT element.
-
getName
String getName()Retrieve the name of this NBT tag.This will be an empty string if the NBT tag is stored in a list.
- Returns:
- Name of the tag.
-
setName
Set the name of this NBT tag.This will be ignored if the NBT tag is stored in a list.
- Parameters:
name- - name of the tag.
-
getValue
TType getValue()Retrieve the value of this NBT tag.Is either a primitive
wrapper,String,Listor aMap.Users are encouraged to cast an NBT compound to
NbtCompoundand use its put and get-methods instead of accessing its content from getValue().All operations that modify collections directly, such as
List.add(Object)orMap.clear(), are considered optional. This also include members inIteratorandListIterator. Operations that are not implemented throw aUnsupportedOperationException.- Returns:
- Value of this tag.
-
setValue
Set the value of this NBT tag.- Parameters:
newValue- - the new value of this tag.
-
deepClone
Clone the current NBT tag.- Specified by:
deepClonein interfaceClonableWrapper- Returns:
- The cloned tag.
-
getHandle
- Specified by:
getHandlein interfaceClonableWrapper
-