2016-08-21 11:26:00 +08:00
|
|
|
package customskinloader.loader;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
|
|
import com.mojang.authlib.GameProfile;
|
|
|
|
|
|
|
|
|
|
import customskinloader.config.SkinSiteProfile;
|
|
|
|
|
import customskinloader.profile.UserProfile;
|
|
|
|
|
|
|
|
|
|
public class ProfileLoader {
|
2018-02-12 12:20:28 +08:00
|
|
|
private static final IProfileLoader[] DEFAULT_LOADERS={
|
|
|
|
|
new MojangAPILoader(),
|
|
|
|
|
new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPI),
|
|
|
|
|
new JsonAPILoader(JsonAPILoader.Type.CustomSkinAPIPlus),
|
2018-07-09 19:53:35 +08:00
|
|
|
new JsonAPILoader(JsonAPILoader.Type.UniSkinAPI),
|
|
|
|
|
new JsonAPILoader(JsonAPILoader.Type.ElyByAPI),
|
|
|
|
|
new LegacyLoader()};
|
2018-02-12 12:20:28 +08:00
|
|
|
|
|
|
|
|
public static final HashMap<String,IProfileLoader> LOADERS=initLoaders();
|
|
|
|
|
|
|
|
|
|
private static HashMap<String, IProfileLoader> initLoaders() {
|
|
|
|
|
HashMap<String, IProfileLoader> loaders=new HashMap<String, IProfileLoader>();
|
|
|
|
|
for(IProfileLoader loader:DEFAULT_LOADERS){
|
|
|
|
|
loaders.put(loader.getName().toLowerCase(), loader);
|
|
|
|
|
}
|
|
|
|
|
return loaders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public interface IProfileLoader {
|
2018-06-25 00:34:32 +08:00
|
|
|
UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception;
|
|
|
|
|
boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1);
|
|
|
|
|
String getName();
|
|
|
|
|
void initLocalFolder(SkinSiteProfile ssp);
|
2018-02-12 12:20:28 +08:00
|
|
|
}
|
2016-08-21 11:26:00 +08:00
|
|
|
}
|