2018-07-09 19:53:35 +08:00
|
|
|
package customskinloader.loader.jsonapi;
|
|
|
|
|
|
2021-05-25 12:55:42 +08:00
|
|
|
import java.util.List;
|
2021-04-24 10:33:18 +08:00
|
|
|
import java.util.Map;
|
|
|
|
|
|
2021-05-25 12:55:42 +08:00
|
|
|
import com.google.common.collect.Lists;
|
2018-07-09 19:53:35 +08:00
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
import com.google.gson.reflect.TypeToken;
|
|
|
|
|
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
|
|
|
|
|
import customskinloader.loader.JsonAPILoader;
|
2021-05-25 12:55:42 +08:00
|
|
|
import customskinloader.plugin.ICustomSkinLoaderPlugin;
|
2018-07-09 19:53:35 +08:00
|
|
|
import customskinloader.profile.ModelManager0;
|
|
|
|
|
import customskinloader.profile.UserProfile;
|
|
|
|
|
|
2021-05-25 12:55:42 +08:00
|
|
|
public class ElyByAPI implements JsonAPILoader.IJsonAPI {
|
2021-04-24 10:33:18 +08:00
|
|
|
|
2021-05-25 12:55:42 +08:00
|
|
|
public static class ElyBy extends JsonAPILoader.DefaultProfile {
|
2023-01-11 22:06:58 +08:00
|
|
|
public ElyBy(JsonAPILoader loader) {
|
|
|
|
|
super(loader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getName() {
|
|
|
|
|
return "ElyBy";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getPriority() {
|
|
|
|
|
return 400;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getRoot() {
|
|
|
|
|
return "http://skinsystem.ely.by/textures/";
|
|
|
|
|
}
|
2021-05-25 12:55:42 +08:00
|
|
|
}
|
|
|
|
|
|
2021-11-04 03:52:05 -03:00
|
|
|
public static class TLauncher extends JsonAPILoader.DefaultProfile {
|
2023-01-11 22:06:58 +08:00
|
|
|
public TLauncher(JsonAPILoader loader) {
|
|
|
|
|
super(loader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getName() {
|
|
|
|
|
return "TLauncher";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getPriority() {
|
|
|
|
|
return 550;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getRoot() {
|
|
|
|
|
return "https://auth.tlauncher.org/skin/profile/texture/login/";
|
|
|
|
|
}
|
2021-11-04 03:52:05 -03:00
|
|
|
}
|
|
|
|
|
|
2021-05-25 12:55:42 +08:00
|
|
|
@Override
|
|
|
|
|
public List<ICustomSkinLoaderPlugin.IDefaultProfile> getDefaultProfiles(JsonAPILoader loader) {
|
2021-11-04 03:52:05 -03:00
|
|
|
return Lists.newArrayList(new ElyBy(loader), new TLauncher(loader));
|
2021-04-24 10:33:18 +08:00
|
|
|
}
|
2018-07-09 19:53:35 +08:00
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String toJsonUrl(String root, String username) {
|
2021-04-24 10:33:18 +08:00
|
|
|
return root + username;
|
2018-07-09 19:53:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public UserProfile toUserProfile(String root, String json, boolean local) {
|
2023-01-11 22:06:58 +08:00
|
|
|
Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> result = new Gson().fromJson(json, new TypeToken<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>>() {
|
|
|
|
|
}.getType());
|
2018-07-09 19:53:35 +08:00
|
|
|
return ModelManager0.toUserProfile(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String getName() {
|
|
|
|
|
return "ElyByAPI";
|
|
|
|
|
}
|
|
|
|
|
}
|