manually merged changes from https://github.com/Gyzie/php-Minecraft-3D-Skin-Renderer