TNT is a world format for Minestom designed for super fast 🚀 loading and portability.
TNT should only be used for small worlds.
Check out the polar world format created by Hollow Cube. It handles version updates and will work better.
⚠ TNT is experimental and is not backwards compatible. Your worlds will break when TNT or Minecraft updates. It is highly recommended to keep your original worlds.
- Very fast loading times (23ms for my lobby - idk what Anvil is)
- Small file size (~80kb in TNT vs ~13mb in Anvil for my lobby)
- Converts from Anvil automatically
- Very portable - can be loaded from databases
- Stores block nbt (e.g. sign text)
- Stores cached light from Anvil (useful because only minestom-ce has a lighting engine)
- World saving
Unfortunately does not save entities (yet) as Minestom does not have entity (de)serialisation.
Importing via Gradle (browse versions here)
repositories {
maven { url "https://repo.emortal.dev/releases" }
}
dependencies {
implementation("dev.emortal.tnt:TNT:{releaseTag}")
}
Creating a Minestom instance
InstanceContainer instance = MinecraftServer.getInstanceManager().createInstanceContainer();
TNTLoader tntLoader = new TNTLoader(instance, new FileTNTSource(Path.of("path/to/world.tnt")));
// or
TNTLoader tntLoader = new TNTLoader(instance, "path/to/world.tnt")
instance.setChunkLoader(tntLoader);
TNT needs some block handlers in order to load block data.
You can find some example handlers in Immortal which are then registered like this
In order for TNT to convert a TNT world automatically, the Anvil folder and TNT file need to be named the same and be in the same folder.
For example:
- /worlds/world/ <- Anvil world folder
- /worlds/world.tnt <- TNT world file (Put this path into the
TNTSource
)
You may also convert an anvil world to TNT manually with TNT.convertAnvilToTNT(pathToAnvil, tntSaveSource)
TNT worlds can be loaded and saved wherever you want (however only FileTNTSource
is built in)
For example, you could make it read from Redis, MongoDB, MySQL or any sort of datastore.
You can do this by extending TNTSource
and creating your own source.
Use TNT.convertChunksToTNT(chunkList, source)