Class NbtReader
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Reads one number out of a gzipped NBT file, the format Minecraft saves its world data in.
public static class NbtReader
- Inheritance
-
NbtReader
- Inherited Members
Remarks
Only reading, and only a long at a known path. Everything else in the file is skipped without being kept. That is all the app needs from it, and not reason enough to take on a library.
It never throws. A world file is somebody's save: it can be truncated by a crash, still being written by the server, or from a version that lays it out differently. Any of those answers "not found", never an exception in the middle of opening a dialog. Lengths and nesting are bounded for the same reason, so a damaged file cannot ask for gigabytes.
Methods
ReadLong(Stream, params string[])
The same, from a stream holding the gzipped file.
public static long? ReadLong(Stream gzipped, params string[] path)
Parameters
Returns
- long?
ReadLong(string, params string[])
The long at path (compound names from the root, root excluded), or null.
public static long? ReadLong(string file, params string[] path)
Parameters
Returns
- long?