blob: cb4f3b6e55131b811a1a652090153d1e6b505e1d [file] [log] [blame] [raw]
This source tree contains utilities for maintaining NBT files and Minecraft
Region files. The primary part is a FUSE-based file system implementation
which allowing NBT file or Minecraft Region file be mounted as a file system,
and then modified using normal file operations.
INSTALL
=======
To build it from source, make sure you have GCC or a compatible C compiler,
GNU Make or BSD make, FUSE development library, as well as zlib development
library installed, then type 'make'; some environment variables are useful to
configure the build:
CC C compiler
AR archive tool for creating static library
CFLAGS prepend flags to C compiler
LDFLAGS prepend flags to linker (e.g. -L <path>)
Example:
$ CC=gcc CFLAGS=-Os make
MONUT THE FILE SYSTEM
=====================
Use program mount.nbt(8) to mount the file system from a NBT file or a Region
file. The synopsis of the command line is:
mount.nbt [-o <fs-options>] [<other-options>] <mount-from-file> <mount-point>
The <fs-options> accepts both FUSE-specific and NBTFS-specific mount options,
some useful ones are:
ro Mount the file system read-only, useful to mount from
a file that can't be written to, or to prevent
accidentally changing it; but see 'writefile' option
later
rw Revert any early 'ro' option
region Specify the mount from file is a Minecraft Region
file instead of a standalone NBT file
typeprefix Use node type prefix for node names when listing
compound nodes as a directory
umask=<mask> Set file mode mask using an octal number for NBT
nodes, default 0
writefile=<path> Set an alternative path for writing NBT data;
the original mount from file won't be written
to if this is specified; has no effect when
file system is mounted read-only
compression={gzip|zlib} Set compression format for writing NBT data;
default 'gzip' for NBT file, 'zlib' for
Region file; has no effect when file system
is mounted read-only
Note the writing happens only when the file system is unmounted; if anything
went wrong during this process, the error message will be sent to syslog(3),
and unfortunately the data is most likely be lost as a result.
Example:
# mount.nbt -o ro,region,umask=0022 /usr/home/minecraft/aether-realm/world/AETHER/region/r.1.1.mca /mnt/region/
# ls -al /mnt/region/80/Level/
total 0
-rw-r--r-- 1 root wheel 256 Jan 1 1970 Biomes
drwxr-xr-x 1 root wheel 1 Jan 1 1970 Entities
drwxr-xr-x 1 root wheel 1024 Jan 1 1970 HeightMap
-rw-r--r-- 1 root wheel 7 Jan 1 1970 InhabitedTime
-rw-r--r-- 1 root wheel 10 Jan 1 1970 LastUpdate
-rw-r--r-- 1 root wheel 2 Jan 1 1970 LightPopulated
drwxr-xr-x 1 root wheel 25 Jan 1 1970 Sections
-rw-r--r-- 1 root wheel 2 Jan 1 1970 TerrainPopulated
drwxr-xr-x 1 root wheel 1 Jan 1 1970 TileEntities
-rw-r--r-- 1 root wheel 2 Jan 1 1970 V
-rw-r--r-- 1 root wheel 3 Jan 1 1970 xPos
-rw-r--r-- 1 root wheel 3 Jan 1 1970 zPos
# ls -al /mnt/region/80/Level/Sections/
total 0
-rw-r--r-- 1 root wheel 9 Jan 1 1970 .type
drwxr-xr-x 1 root wheel 6 Jan 1 1970 0
drwxr-xr-x 1 root wheel 6 Jan 1 1970 1
drwxr-xr-x 1 root wheel 6 Jan 1 1970 2
drwxr-xr-x 1 root wheel 6 Jan 1 1970 3
# cat /mnt/region/80/Level/?Pos
48
34