mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-13 06:37:28 +00:00
* Enhance ICustomSkinLoaderPlugin. * Support auto update config file per snapshot. Fix crash with forge 1.14.2 ~ 1.15.2. * ElyByAPI should check root now. * Remove unnecessary packages, add some deprecated loaders. * Reformat imports. * Move forge stuffs to another commit. * Fix config updating incorrectly.
34 lines
1.3 KiB
Java
34 lines
1.3 KiB
Java
package customskinloader.loader;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import com.mojang.authlib.GameProfile;
|
|
import customskinloader.CustomSkinLoader;
|
|
import customskinloader.config.SkinSiteProfile;
|
|
import customskinloader.plugin.ICustomSkinLoaderPlugin;
|
|
import customskinloader.plugin.PluginLoader;
|
|
import customskinloader.profile.UserProfile;
|
|
|
|
public class ProfileLoader {
|
|
public static final HashMap<String,IProfileLoader> LOADERS=initLoaders();
|
|
|
|
private static HashMap<String, IProfileLoader> initLoaders() {
|
|
HashMap<String, ProfileLoader.IProfileLoader> profileLoaders = new HashMap<String, ProfileLoader.IProfileLoader>();
|
|
for (ICustomSkinLoaderPlugin plugin : PluginLoader.PLUGINS.values()) {
|
|
ProfileLoader.IProfileLoader profileLoader = plugin.getProfileLoader();
|
|
if (profileLoader != null) {
|
|
profileLoaders.put(profileLoader.getName().toLowerCase(), profileLoader);
|
|
CustomSkinLoader.logger.info("Add a profile loader: " + profileLoader.getName());
|
|
}
|
|
}
|
|
return profileLoaders;
|
|
}
|
|
|
|
public interface IProfileLoader {
|
|
UserProfile loadProfile(SkinSiteProfile ssp,GameProfile gameProfile) throws Exception;
|
|
boolean compare(SkinSiteProfile ssp0,SkinSiteProfile ssp1);
|
|
String getName();
|
|
void init(SkinSiteProfile ssp);
|
|
}
|
|
}
|