Posts Tagged ‘Minecraft’
New Minecraft save format; HaskellNBT on hold for now
Looks likeĀ Minecraft will be getting a new save format:

Hopefully my library-in-progress, HaskellNBT, won’t be completely useless after this change. Thankfully, notch has helpfully agreed to document the new format:

Thanks to the excellent Data.Binary machinery, a new format should be straightforward to support. All one must do to change the binary representation of a type is update the get and put methods on the Binary instance declaration for a type. This class similar to java.io.Serializable from the Java Serialization API, but doesn’t make the programmer worry about streams and exceptions. It only requires functions to and from a ByteString.
Minecraft data API for Haskell: HaskellNBT
I’ve lost my fair share of hours to Minecraft over the break. If you ever had fun with Legos, you owe it to yourself to check it out. I made a T-Rex:

Of course, I couldn’t just stop at playing the game, I had to start something even nerdier: a Haskell library for manipulating Minecraft data. Minecraft saves worlds in a simple binary format, Named Binary Tag.
The specification is simple, and I was able to throw together a prototype in a couple hours. It’s up on GitHub now: https://github.com/acfoltzer/nbt
I’m still figuring out idioms for Haskell libraries, but I plan to add higher-level interfaces for manipulating entire worlds, rather than just the low-level NBT representations. What sorts of applications might be fun to see after that?