diff --git a/Common/source/customskinloader/config/Config.java b/Common/source/customskinloader/config/Config.java index f52f79a..b8f1ae3 100644 --- a/Common/source/customskinloader/config/Config.java +++ b/Common/source/customskinloader/config/Config.java @@ -27,7 +27,7 @@ public class Config { public boolean forceIgnoreHttpsCertificate = false; public boolean forceLoadAllTextures = true; public boolean enableCape = true; - public int threadPoolSize = 3; + public int threadPoolSize = 8; /** * Can logger write message to standard output(System.out). * Because standard output won't write to latest.log after Forge 1.17, diff --git a/Common/source/customskinloader/loader/LegacyLoader.java b/Common/source/customskinloader/loader/LegacyLoader.java index 96469d3..9486e22 100644 --- a/Common/source/customskinloader/loader/LegacyLoader.java +++ b/Common/source/customskinloader/loader/LegacyLoader.java @@ -24,7 +24,12 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro @Override public List getDefaultProfiles() { - return Lists.newArrayList(new LocalSkin(this), new OptiFineCape(this)); + return Lists.newArrayList(new LocalSkin(this), + getCapeProfile(this, "OptiFine", "https://optifine.net/capes/{USERNAME}.png", 810), + getCapeProfile(this, "CloakPlus", "http://161.35.130.99/capes/{USERNAME}.png", 840), + getCapeProfile(this, "LabyMod", "https://dl.labymod.net/capes/{STANDARD_UUID}", 850), + getCapeProfile(this, "Cosmetica", "https://api.cosmetica.cc/get/cloak?username={USERNAME}&uuid={STANDARD_UUID}¬hirdparty", 860) + ); } public abstract static class DefaultProfile implements ICustomSkinLoaderPlugin.IDefaultProfile { @@ -95,46 +100,47 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro } /** - * OptiFine cape - * Test player: Notch and OptiFineCape + * Get cape Profile¬ * * @since 14.16 */ + public static LegacyLoader.DefaultProfile getCapeProfile(LegacyLoader loader, String name, String capeRoot, int priority) { + return new DefaultProfile(loader) { + @Override + public String getSkinRoot() { + return null; + } - public static class OptiFineCape extends LegacyLoader.DefaultProfile { - public OptiFineCape(LegacyLoader loader) { - super(loader); - } + @Override + public String getCapeRoot() { + return capeRoot; + } - @Override - public String getName() { - return "OptiFine"; - } + @Override + public String getElytraRoot() { + return null; + } - @Override - public int getPriority() { - return 810; - } + @Override + public String getName() { + return name; + } - @Override - public String getSkinRoot() { - return null; - } - - @Override - public String getCapeRoot() { - return "https://optifine.net/capes/{USERNAME}.png"; - } - - @Override - public String getElytraRoot() { - return null; - } + @Override + public int getPriority() { + return priority; + } + }; } public static final String USERNAME_PLACEHOLDER = "{USERNAME}"; public static final String UUID_PLACEHOLDER = "{UUID}"; - public static final String UUID_STANDARD_PLACEHOLDER = "{UUID_STANDARD}"; + /** + * Mojang UUID with - + * + * @since 14.16 + */ + public static final String STANDARD_UUID_PLACEHOLDER = "{STANDARD_UUID}"; @Override public UserProfile loadProfile(SkinSiteProfile ssp, GameProfile gameProfile) { @@ -216,7 +222,7 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro private String expandURL(String url, String username) { String t = url.replace(USERNAME_PLACEHOLDER, username); - if (!t.contains(UUID_PLACEHOLDER) && !t.contains(UUID_STANDARD_PLACEHOLDER)) { + if (!t.contains(UUID_PLACEHOLDER) && !t.contains(STANDARD_UUID_PLACEHOLDER)) { return t; } String uuid = MojangAPILoader.getMojangUuidByUsername(username, true); @@ -225,6 +231,6 @@ public class LegacyLoader implements ICustomSkinLoaderPlugin, ProfileLoader.IPro return null; } String styledUuid = uuid.replace("-", ""); - return t.replace(UUID_PLACEHOLDER, styledUuid).replace(UUID_STANDARD_PLACEHOLDER, uuid); + return t.replace(UUID_PLACEHOLDER, styledUuid).replace(STANDARD_UUID_PLACEHOLDER, uuid); } } diff --git a/README.md b/README.md index b4555f2..1cb040e 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,9 @@ By using this mod, you can see correct avatar of players in Spectator Menu rathe - [MinecraftCapes](https://minecraftcapes.net/) - [OptiFineCape](https://optifine.net/home) - [Wynntils](https://wynntils.com/) +- [Cloaks+](https://cloaksplus.com/) +- [LabyMod](https://www.labymod.net/en) +- [Cosmetica](https://cosmetica.cc/) If you want to apply to add other skin server to default list, please go to [issue](https://github.com/JLChnToZ/MCCustomSkinLoader/issues).