GitXplorerGitXplorer
d

libnbt

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
72ea67974076cbd17ca91984666426388f747257

Initial Code Commit

ddarichey committed 8 years ago
Unverified
6a605f1ae50bb87ba19bc1b9c851bb878b67a4b9

Initial commit

GGrandPanda committed 8 years ago

README

The README file for this repository.

#libnbt A small library for reading the Named Binary Tag (NBT) format.

##Adding libnbt as a dependency

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
   <dependency>
        <groupId>com.github.grandpanda</groupId>
        <artifactId>libnbt</artifactId>
        <version>1.0</version>
    </dependency>
</dependencies>

##Quick Start Currently, this library supports the reading of uncompressed NBT files, gzip compressed NBT files, and .mca files. The following example exhibits the reading of each file.

public class Main {
	public static void main(String[] args) {
		// Reading an uncompressed nbt file
        TagCompound uncompressed = LibNBT.readFromNBTFile(new File("uncompressed.nbt"), false);
        TagByte tagByte = (TagByte) uncompressed.get("byte"); // Reading a tag called "byte" from the compound.

        // Reading a compressed nbt file
        TagCompound compressed = LibNBT.readFromNBTFile(new File("compressed.nbt"), true);
        TagByte tagByte = (TagByte) compressed.get("byte"); // Reading a tag called "byte" from the compound.

        // Reading a .mca region file
        List<TagCompound> tags = LibNBT.readFromMCAFile(new File("r.0.0.mca"));
	}
}

##Notes The writing of NBT files is not currently supported by this library.