classSource
public class WriterConstructors
public Writer()Methods
void writeFile(File, NbtCompound)Writes the given NBT tree to a file, Gzip compressed (like the original Minecraft nbt files)
Goes through a temp file, so a crash halfway through doesn't leave you with half a level.datvoid writeFile(File, NbtCompound, File)Like writeFile(File, NbtCompound), but the old file is copied to backup first (think level.dat_old)void writeFileUncompressed(File, NbtCompound)Writes the given NBT tree uncompressed.public static void writeFile(File file, NbtCompound nbt) throws IOExceptionWrites the given NBT tree to a file, Gzip compressed (like the original Minecraft nbt files)
Goes through a temp file, so a crash halfway through doesn't leave you with half a level.dat
| Parameters | ||
|---|---|---|
file | File | Target file |
nbt | NbtCompound | Root compound, e.g. as returned by Parser.readFile |
| Throws | ||
IOException | If writing fails, the old file is still fine then | |
public static void writeFile(File file, NbtCompound nbt, File backup) throws IOExceptionLike
writeFile(File, NbtCompound), but the old file is copied to backup first (think level.dat_old)| Parameters | ||
|---|---|---|
file | File | |
nbt | NbtCompound | |
backup | File | |
| Throws | ||
IOException | If writing or copying fails, the old file is still fine then | |
public static void writeFileUncompressed(File file, NbtCompound nbt) throws IOExceptionWrites the given NBT tree uncompressed. Useful for debugging or
formats that don't expect Gzip (e.g. individual chunk payloads
that are compressed at the region-file level instead).
Also goes through a temp file
| Parameters | ||
|---|---|---|
file | File | |
nbt | NbtCompound | |
| Throws | ||
IOException | ||