Skip to content

@Dufji is stupid and spent over a week trying to make an implementation... I did it in a few hours (because i overcomplicated it)

Notifications You must be signed in to change notification settings

Badbird5907/NBTParser

Repository files navigation

NBTParser

A library to serialize minecraft NBT data into JSON

Usage

public class Hello {
    public static String getNBTJson(net.minecraft.nbt.NBTTagCompound nbt) {
        // GenericNBTPlatform is completely platform independent, and relies on reflection to access the NBT data/class type.
        // Based off 1.12.2 docs.
        GenericNBTPlatform platform = new GenericNBTPlatform();
        NBTParser parser = new NBTParserImpl(platform); // NBTParserImpl is the default implementation of NBTParser

        dev.badbird.nbtparser.nbt.NBTTagCompound compound = platform.createCompoundFromMC(nbt); // Create a NBTParser NBTTagCompound from a Minecraft NBTTagCompound
        String json = parser.toJson(compound); // Serialize the NBTParser NBTTagCompound into JSON
        return json;
    }
}

Why?

Because Dufji is dumb and kept asking me to spoonfeed him on parsing NBTTagCompond to JSON for over a week

So i made this to spoonfeed him lol, but in the process made it really complicated because:

why the fuck not?

After all, we're programmers, we overcomplicate things just because we can

About

@Dufji is stupid and spent over a week trying to make an implementation... I did it in a few hours (because i overcomplicated it)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published