overviewer / Overviewer-Web

the docker swarm running overviewer.org
9 stars 10 forks source link

Slim player skins render incorrectly #45

Open Chi-Yu opened 4 years ago

Chi-Yu commented 4 years ago

avatar.py doesn't currently support slim player skins which causes the wrong parts of the texture to be used to render player icons.

Example: Player Skin

The API documentation states:

The "SKIN" object will have "metadata": {"model": "slim"} if the player model has slim arms. For square arms, "metadata" will be missing.

Seeing that there is currently only get_skin_url(), I'd say that avatar.py requires a tiny bit of refactoring to not only retrieve the URL but also "metadata" if present so create_av_from_skin() can use different image coordinates for slim skins.

Chi-Yu commented 4 years ago

Here is my attempt at adding this feature.

This branch also (hopefully?) fixes some of the arm and leg textures apparently using the wrong coordinates. I used the updated reference textures from the Minecraft wiki.

Since I'm on Windows, I couldn't get the whole docker thing running so I wasn't able to test these changes myself.

I'd be happy if someone could do a review and maybe even test the changes, especially with regards to image coordinates to make sure that everything lines up properly.