Skip to content
/ nbt Public

Simple yet powerful library for serializing and deserializing data in NBT format.

License

Notifications You must be signed in to change notification settings

tommyskeff/nbt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBT

Simple yet powerful library for serializing and deserializing data in NBT format.

Dependency

<repositories>
    <repository>
        <id>tommyjs-repo</id>
        <url>https://repo.tommyjs.dev/repository/maven-releases</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>dev.tommyjs</groupId>
        <artifactId>nbt</artifactId>
        <version>2.0.1</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Examples

FileInputStream stream = new FileInputStream("bigtest.nbt");
GZIPInputStream gis = new GZIPInputStream(stream);
CompoundTag tag = Nbt.getApi().read(gis);
System.out.println(tag);
Tag tag = ...
byte[] binData = Nbt.getApi().serialize(tag);
System.out.println(Arrays.toString(binData));
byte[] data = ...
CompoundTag tag = Nbt.getApi().deserialize(data);
System.out.println(tag.getInt("MyIntegerField"));