Files
MCCustomSkinLoader/Common/source/customskinloader/loader/ProfileLoader.java
T

33 lines
1.3 KiB
Java
Raw Normal View History

2016-08-21 11:26:00 +08:00
package customskinloader.loader;
import java.util.HashMap;
import com.mojang.authlib.GameProfile;
2021-04-24 10:33:18 +08:00
import customskinloader.CustomSkinLoader;
2016-08-21 11:26:00 +08:00
import customskinloader.config.SkinSiteProfile;
2021-04-24 10:33:18 +08:00
import customskinloader.plugin.ICustomSkinLoaderPlugin;
2019-03-08 13:38:44 +08:00
import customskinloader.plugin.PluginLoader;
2016-08-21 11:26:00 +08:00
import customskinloader.profile.UserProfile;
public class ProfileLoader {
public static final HashMap<String, IProfileLoader> LOADERS = initLoaders();
2018-02-12 12:20:28 +08:00
private static HashMap<String, IProfileLoader> initLoaders() {
HashMap<String, ProfileLoader.IProfileLoader> profileLoaders = new HashMap<>();
for (ICustomSkinLoaderPlugin plugin : PluginLoader.PLUGINS) {
2021-04-24 10:33:18 +08:00
ProfileLoader.IProfileLoader profileLoader = plugin.getProfileLoader();
if (profileLoader != null) {
profileLoaders.put(profileLoader.getName().toLowerCase(), profileLoader);
CustomSkinLoader.logger.info("Add a profile loader: " + profileLoader.getName());
}
2018-02-12 12:20:28 +08:00
}
2021-04-24 10:33:18 +08:00
return profileLoaders;
2018-02-12 12:20:28 +08:00
}
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();
2019-09-18 22:15:58 +08:00
void init(SkinSiteProfile ssp);
2018-02-12 12:20:28 +08:00
}
2016-08-21 11:26:00 +08:00
}