QuiltServerTools / BlockBot

A Minecraft - Discord chat linking mod
Creative Commons Zero v1.0 Universal
27 stars 22 forks source link

[Feature Request] Add support for FabricTailor skins #26

Open elhertz opened 3 years ago

elhertz commented 3 years ago

Display FabricTailor heads on discord. Hope it is possible, thanks!

emielderckx commented 3 years ago

Tom is right

Tom-The-Geek commented 3 years ago

FabricTailor's primary purpose is to allow changing of skins on regular server/in singleplayer, so I see no reason for it to be unsupported; however, SkinRestorer will probably never be supported officially, as it is specifically designed for offline mode servers.

Also, @emielderckx your phrasing sounds a little like you are attacking the issue author, there are better ways of explaining that piracy is unsupported :P

elhertz commented 3 years ago

@emielderckx you are right. I should have thought about it before asking for support. My bad. @Tom-The-Geek thank you for taking my request in consideration.

samolego commented 3 years ago

Hi there, author of FabricTailor here :). You could request skin value from FT's interface TailoredPlayer (see code). Then decode that string (it's encoded using Base64 format), what you're looking for is SKIN -> url value.

samolego commented 3 years ago

(edit)

From by calling ((TailoredPlayer) player).getValue(); you'd get a string like this


``` ewogICJ0aW1lc3RhbXAiIDogMTYzMTc5ODEzMzY1OCwKICAicHJvZmlsZUlkIiA6ICI5NTBhOTg3ZDBkNDA0OThhYmU5OGRkMTc1NzFlNWUyZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJzYW1vX2xlZ28iLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIyOWVkYTk1OTc5MWY1NGMyNmMyMzI4MzJiNzY2MDRlYmExYWM0ZmU0MTZhZWIzNTZjMzM1ZWExZTFiYmU3IgogICAgfSwKICAgICJDQVBFIiA6IHsKICAgICAgInVybCIgOiAiaHR0cDovL3RleHR1cmVzLm1pbmVjcmFmdC5uZXQvdGV4dHVyZS8yMzQwYzBlMDNkZDI0YTExYjE1YThiMzNjMmE3ZTllMzJhYmIyMDUxYjI0ODFkMGJhN2RlZmQ2MzVjYTdhOTMzIgogICAgfQogIH0KfQ== ```

which you then decode and get

{
  "timestamp" : 1631798133658,
  "profileId" : "950a987d0d40498abe98dd17571e5e2f",
  "profileName" : "samo_lego",
  "textures" : {
    "SKIN" : {
      "url" : "http://textures.minecraft.net/texture/eb29eda959791f54c26c232832b76604eba1ac4fe416aeb356c335ea1e1bbe7"
    },
    "CAPE" : {
      "url" : "http://textures.minecraft.net/texture/2340c0e03dd24a11b15a8b33c2a7e9e32abb2051b2481d0ba7defd635ca7a933"
    }
  }
}
samolego commented 3 years ago

Leaving https://github.com/crafatar/crafatar/issues/54 for reference.

samolego commented 2 years ago

There seems to be a way to do this using https://mc-heads.net/ (comment in crafatar issue)