Package com.kovuthehusky.nbt
Class NBTWriter
- java.lang.Object
-
- com.kovuthehusky.nbt.NBTWriter
-
public class NBTWriter extends java.lang.ObjectClass for writing NBT structures as NBT, JSON, or XML.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidwriteJSON(NBT<?> root, java.io.File file)Writes the tag specified and its children as JSON text.static voidwriteNBT(NBT<?> root, java.io.File file)Writes the tag specified and its children as NBT binary data.static voidwriteNBT(NBT<?> root, java.io.File file, boolean compressed)Writes the tag specified and its children as NBT binary data.static voidwriteXML(NBT<?> root, java.io.File file)Writes the tag specified and its children as XML text.
-
-
-
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.
-
-