Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
/ TNT Public archive

TNT is an experimental world format for Minestom

License

Notifications You must be signed in to change notification settings

emortalmc/TNT

Repository files navigation

EmortalMC Banner

TNT

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.

Cool stuff

Unfortunately does not save entities (yet) as Minestom does not have entity (de)serialisation.

Usage

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);

Signs are blank? (or any other block has no data)

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

Anvil Conversion

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 Sources

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.

Saving

Use TNT.convertChunksToTNT(chunkList, source)