Class CompoundTagType
java.lang.Object
com.viaversion.viaversion.api.type.Type<com.viaversion.nbt.tag.CompoundTag>
com.viaversion.viaversion.api.type.types.misc.CompoundTagType
- All Implemented Interfaces:
ByteBufReader<com.viaversion.nbt.tag.CompoundTag>,ByteBufWriter<com.viaversion.nbt.tag.CompoundTag>,CodecWriter<com.viaversion.nbt.tag.CompoundTag>
Compound tag type, functionally equivalent to
TagType with an additional cast.
On the network, this is technically written as any tag, but almost always cast to and checked as a CompoundTag, so we provide this type for convenience.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.viaversion.viaversion.api.type.Type
getBaseClass, getOutputClass, getTypeName, toString
-
Constructor Details
-
CompoundTagType
public CompoundTagType() -
CompoundTagType
public CompoundTagType(boolean limitMaxBytes)
-
-
Method Details
-
read
public com.viaversion.nbt.tag.CompoundTag read(io.netty.buffer.ByteBuf buffer) Description copied from interface:ByteBufReaderReads a value from a ByteBuf.- Parameters:
buffer- buffer to read from- Returns:
- type based on the class type
-
write
public void write(io.netty.buffer.ByteBuf buffer, com.viaversion.nbt.tag.CompoundTag object) Description copied from interface:ByteBufWriterWrites an object to a type to a ByteBuf.- Parameters:
buffer- buffer to write toobject- value to write
-
write
- Specified by:
writein interfaceCodecWriter<com.viaversion.nbt.tag.CompoundTag>- Overrides:
writein classType<com.viaversion.nbt.tag.CompoundTag>
-