novablocks · 2022Texture Packs
3 min read
Texture Packs Version 1
PR Date: June 20, 2022
The initial task that I got when I got onboarded to the project is to work on the texture packs. The game has a default texture pack that is used in the game. The goal is to let the user change the texture pack of the world via the admin panel.
For the first iteration, I've designed the database structure that will map to the required textures for a specified block.

- Config: the settings which is a key-value pair. Currently, it only contains "Default Texture Pack"
- Texture Packs: the texture pack which contains its name (e.g. Pastelcraft or FPS Pack) and the zip file.
- Block Textures: the name of the textures available (e.g. cobblestone, grass_top). The default texture pack determines what texture file to fetch for this.
- Block Texture Files: this is the image file of a certain block texture and texture pack. (e.g. image file of FPS texture pack and cobblestone block)
- Block: the box geometry definition of a block, it contains the texture file path for each faces, its name, and options.
Then I've updated the engine to enable using a custom texture pack based on the settings in the Admin panel. A zip file of the texture pack can be uploaded in the admin panel to which it will contain block texture images in which the name of the images is based on the Minecraft name convention. For migrating the zip file, I've run it using background jobs, write the blob to a Tempfile
, then read the contents using rubyzip. Since reading the zip file takes up a lot of RAM depending on the file size, we had to also increase the RAM of the server.



Texture Pack Version 2
Coming Soon.