Class NBTWriter


  • public class NBTWriter
    extends java.lang.Object
    Class for writing NBT structures as NBT, JSON, or XML.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void writeJSON​(NBT<?> root, java.io.File file)
      Writes the tag specified and its children as JSON text.
      static void writeNBT​(NBT<?> root, java.io.File file)
      Writes the tag specified and its children as NBT binary data.
      static void writeNBT​(NBT<?> root, java.io.File file, boolean compressed)
      Writes the tag specified and its children as NBT binary data.
      static void writeXML​(NBT<?> root, java.io.File file)
      Writes the tag specified and its children as XML text.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • writeJSON

        public static void writeJSON​(NBT<?> root,
                                     java.io.File file)
                              throws java.io.FileNotFoundException
        Writes the tag specified and its children as JSON text.
        Parameters:
        root - The root tag to write.
        file - The file to write to.
        Throws:
        java.io.FileNotFoundException - If the file being written to does not exist.
      • writeNBT

        public static void writeNBT​(NBT<?> root,
                                    java.io.File file)
                             throws java.io.FileNotFoundException
        Writes the tag specified and its children as NBT binary data.
        Parameters:
        root - The root tag to write.
        file - The file to write to.
        Throws:
        java.io.FileNotFoundException - If the file being written to does not exist.
      • writeNBT

        public static void writeNBT​(NBT<?> root,
                                    java.io.File file,
                                    boolean compressed)
                             throws java.io.FileNotFoundException
        Writes the tag specified and its children as NBT binary data.
        Parameters:
        root - The root tag to write.
        file - The file to write to.
        compressed - Whether or not the file should be compressed.
        Throws:
        java.io.FileNotFoundException - If the file being written to does not exist.
      • writeXML

        public static void writeXML​(NBT<?> root,
                                    java.io.File file)
                             throws java.io.FileNotFoundException
        Writes the tag specified and its children as XML text.
        Parameters:
        root - The root tag to write.
        file - The file to write to.
        Throws:
        java.io.FileNotFoundException - If the file being written to does not exist.