Add %uuid% placeholder for skin-url

This commit is contained in:
James Lyne 2022-01-07 22:53:18 +00:00
parent 25950167ec
commit 27aa077116

View File

@ -108,10 +108,12 @@ public class PlayerFaces {
private class LoadPlayerImages implements Runnable { private class LoadPlayerImages implements Runnable {
private SkinUrlProvider mSkinUrlProvider; private SkinUrlProvider mSkinUrlProvider;
public final String playername; public final String playername;
public final UUID playeruuid;
public final String playerskinurl; public final String playerskinurl;
public LoadPlayerImages(String playername, String playerskinurl, UUID playeruuid, SkinUrlProvider skinUrlProvider) { public LoadPlayerImages(String playername, String playerskinurl, UUID playeruuid, SkinUrlProvider skinUrlProvider) {
this.playername = playername; this.playername = playername;
this.playeruuid = playeruuid;
this.playerskinurl = playerskinurl; this.playerskinurl = playerskinurl;
mSkinUrlProvider = skinUrlProvider; mSkinUrlProvider = skinUrlProvider;
} }
@ -131,7 +133,8 @@ public class PlayerFaces {
if (mSkinUrlProvider == null) { if (mSkinUrlProvider == null) {
if (!skinurl.equals("")) { if (!skinurl.equals("")) {
url = new URL(skinurl.replace("%player%", URLEncoder.encode(playername, "UTF-8"))); url = new URL(skinurl.replace("%player%", URLEncoder.encode(playername, "UTF-8"))
.replace("%uuid%", playeruuid.toString()));
} else if (playerskinurl != null) { } else if (playerskinurl != null) {
url = new URL(playerskinurl); url = new URL(playerskinurl);
} }