StickyPiston Resource Pack API

All copyright for the Resource Pack API and associated code remains with StickyPiston Hosting Ltd. This page is just to illustrate that Oliver worked on the system. Everything on this page has been approved for public representation.

Overview

The resource pack API is a backend system that allows the uploading and managing of resource packs programmatically. Meaning that a frontend website can be used to edit the resource packs available, or another backend script can be used. Allowing multiple different sources to manage the same set of resource packs.

This system can be best seen in action as a part of the StickyPiston World Manager


Development

There is an authentication layer on the API that uses a combination of static token and cookie based authentication. Without being authenticated, none of the API endpoints work and will return 401 Unauthorized.

The technologies used for this system were:

Endpoints

There are API endpoints for the following functionality for the system:

  • Uploading and Deleting resource packs
  • Downloading a resource pack from the system
  • Updating and Retrieving the resource pack metadata
  • Receiving an authentication cookie for allowing future requests

Metadata

When each resource pack gets uploaded to the API, they get processed to extract certain information from them and to validate them to ensure the resource pack is properly supported by Minecraft. Each of the metadata files contain the following properties:

PropertyDescription
hashThe hash that can be used in requests where a hash is required in the URI path.
download_uriThe path that is appended to the domain name to be able to download the resource pack from.
dateThe datetime serialization that represents when the resource pack was uploaded.
upload_originAn indicator used to tell how the resource pack was uploaded. This is determined by the authentication scheme used. Cookies will result in a value of "site", static auth tokens will result in a value of "api"
mc_can_downloadWhether or not the Minecraft client will be able to download the resource pack, this is determined based on the size of the file uploaded and the pack_format within the resource pack’s pack.mcmeta file.
descriptionThis is the description of the pack. The default value of this is pulled from the pack’s pack.mcmeta file.

This is not an exhaustive list of all properties within the metadata.

Some properties in this file are not returned to clients when requesting the information and some are static, meaning that they cannot be updated through the API.


Oliver Akins © 2022. All rights reserved.