samolego / FabricTailor

A server-side or singleplayer skin changing mod for fabric.
https://modrinth.com/mod/FabricTailor
GNU Lesser General Public License v3.0
109 stars 16 forks source link

[Suggestion] API For mod developers #66

Closed hypherionmc closed 2 years ago

hypherionmc commented 2 years ago

Hi there.

I was wondering if there is currently a way, or if not, if a way can be added, to get skins from the mod.

Say I have a server side mod that relays chats to discord, and I want to use the head of a player as an avatar, is there a way to get the URL from the mod for the active skin?

samolego commented 2 years ago

Yes, there is exactly this method available :)

samolego commented 2 years ago

See https://github.com/samolego/FabricTailor/blob/97a4019ed212c911d2e89e5bb1e4fe11e7b9fb98/src/main/java/org/samo_lego/fabrictailor/casts/TailoredPlayer.java#L76

hypherionmc commented 2 years ago

Thanks for the reply :). Does this only work with Mojang skins or also with custom skins (like your mod supports)?

samolego commented 2 years ago

It gets you the set skin id, which you can use in combination with https://mc-heads.net/avatar/textureid

samolego commented 2 years ago

Yeah, works with fabrictailor skin and falls back to mojang if not set.