Flayer is a Minecraft skin cache server, indexed by the player's UUID.
Make sure you have go
installed before running these commands.
export GOPATH=/some/path
go get github.com/hugopeixoto/minecraft/flayer
/some/path/bin/flayer -cachedir /var/www/assets -listen your-server.com:8080 -interval 24
You can specify the cache location, the listen address for the webserver, and the interval in which the cache must be checked for skin updates (in hours).
Retrieving the full skin:
<img src='http://your-server.com:8080/skins/61208bec81194e228b4f510cd9aa6fe0/full.png'/>
You can retrieve the skin's head, in several resolutions:
<img src='http://your-server.com:8080/skins/61208bec81194e228b4f510cd9aa6fe0/head-32.png'/>
<img src='http://your-server.com:8080/skins/61208bec81194e228b4f510cd9aa6fe0/head-48.png'/>
<img src='http://your-server.com:8080/skins/61208bec81194e228b4f510cd9aa6fe0/head-64.png'/>
And that's it! If the given profile doesn't exist, it defaults to steve
(creating a symlink for each uuid). If something else goes wrong, flayer will
respond with 404 Not found
.
You can point nginx/apache to the cachedir, to spare flayer from unnecessary hits.
Use try_files
or RewriteCond/Rule
to do this.
- Currently, the available resolutions are hardcoded. Make this dynamic/configurable.
- Add authentication/authorization, so that we only generate skins for authorized callers.
- Place all configuration settings in a json file.
This was definitely inspired by minotar. The main difference (apart from the lack of features of Flayer) is that Flayer caches the heads.