Skip to content

✳️ A CraftBukkit Slime world format chunk loader

License

Notifications You must be signed in to change notification settings

voodootje0/Slime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✳️ Slime

Slime is a Minecraft world file format described by the Hypixel developers on one of their dev blogs. This format was originally designed to store SkyBlock player islands. As so, the main focus of this format is small worlds, guaranteeing a higher compression rate, and using less disk space than Minecraft's default Region file format.

This projects provides a CraftBukkit Slime chunk loader based on "in-memory" worlds, which don't use disk storage at all. This is extremely useful for minigame servers, where the maps tend to be small (they fit nicely in memory), and no world saving is needed.

How does it work?

We "inject" the custom chunk loader by providing a ServerNBTManager that overrides the createChunkLoader. This method returns a SlimeChunkLoader, which is where the main program logic lies.

When the server starts, this loader reads the Slime world file located at <world-dir>/chunks.slime and creates ProtoSlimeChunk instances, which contain the raw chunk information. Whenever the chunk is requested by the server, this proto chunk is converted into a regular NMS Chunk, with all its entities, blocks, skylight information...

This approach was taken for two reasons:

  1. Instantiating NMS Chunks on startup uses much more CPU and memory than proto chunks. These only store the strictly necessary info in primitives.
  2. On the other hand, waiting for a chunk load request to read the Slime file is too slow. Instead, the file reading is performed during startup. Converting a proto chunk into a NMS Chunk is really cheap, since the data is already in memory.

Once a chunk is loaded, it will be kept in memory until the server shuts down. Successive loads will return the cached chunk instead of performing the proto conversion.

Limitations

There's limited available information about the Slime format, so some assumptions were made. For example, the blog post doesn't detail the storage structure of multiple(?) slime files. We assumed they all fit in a single file, <world-dir>/chunks.slime.

The provided slime-tools contains a saving reference implementation, and seems to be for version 1, since it doesn't include entity information. This project supports both version 1 and 3 (spec) of the format.

How do I use this?

This project is under heavy development and testing, so no CraftBukkit/Spigot/Paper patches are available as of now.

Can I contribute?

Yes! We need to perform extensive testing before this project becomes stable. Please, feel free to fix bugs, add documentation, tests...

Note you will need to manually run BuildTools to install Spigot 1.8.8 locally.

License

MIT © Hugo Manrique

About

✳️ A CraftBukkit Slime world format chunk loader

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages