Fix 1.8-1.8.9 texture binding mistake

Support new UniSkinApi
This commit is contained in:
Alexander Xia committed 2016-03-13 00:17:11 +08:00
1 parent 03388e3f85
commit bebbbb0050
6 files changed
+18 -12

No files matched your search

@@ -15,7 +15,7 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
* It is the only class in package 'customskinloader' which has differences in different Minecraft version.
* @since 13.1
*/
public class ModelManager {
public class ModelManager0 {
private static ArrayList<String> models=null;
/**
@@ -49,7 +49,7 @@ public class CustomSkinLoader {
logger.info((i+1)+"/"+config.loadlist.length+" Try to load profile from '"+ssp.name+"'.");
if(ssp.type.equalsIgnoreCase("MojangAPI") && !defaultProfile.isEmpty()){
logger.info("Default profile will be used.");
logger.info(ModelManager.toUserProfile(defaultProfile).toString());
logger.info(ModelManager0.toUserProfile(defaultProfile).toString());
return defaultProfile;
}
IProfileLoader loader=LOADERS.get(ssp.type.toLowerCase());
@@ -67,7 +67,7 @@ public class CustomSkinLoader {
continue;
logger.info(username+"'s profile loaded.");
logger.info(profile.toString());
return ModelManager.fromUserProfile(profile);
return ModelManager0.fromUserProfile(profile);
}
return defaultProfile;
}
@@ -13,7 +13,7 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
* It is the only class in package 'customskinloader' which has differences in different Minecraft version.
* @since 13.1
*/
public class ModelManager {
public class ModelManager0 {
private static ArrayList<String> models=null;
/**
@@ -6,7 +6,7 @@ import java.util.Set;
import com.google.gson.Gson;
import customskinloader.CustomSkinLoader;
import customskinloader.ModelManager;
import customskinloader.ModelManager0;
import customskinloader.UserProfile;
import customskinloader.config.SkinSiteProfile;
import customskinloader.utils.HttpUtil0;
@@ -29,8 +29,10 @@ public class CustomSkinAPILoader implements IProfileLoader {
if(profile.skins!=null && !profile.skins.isEmpty()){
Set<String> keys=profile.skins.keySet();
for(String s:keys){
System.out.println(s+" "+ModelManager.checkModel(s));
if(ModelManager.checkModel(s)){
//System.out.println(s+" "+ModelManager0.checkModel(s));
if(ModelManager0.checkModel(s)){
if(profile.skins.get(s)==null||profile.skins.get(s).equals(""))
continue;
p.skinUrl=ssp.root+TEXTURES+profile.skins.get(s);
p.model=s;
break;
@@ -11,7 +11,7 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import com.mojang.authlib.properties.Property;
import customskinloader.CustomSkinLoader;
import customskinloader.ModelManager;
import customskinloader.ModelManager0;
import customskinloader.UserProfile;
import customskinloader.config.SkinSiteProfile;
import customskinloader.utils.HttpUtil0;
@@ -59,7 +59,7 @@ public class MojangAPILoader implements IProfileLoader {
return null;
}
//Get Texture End
return ModelManager.toUserProfile(texture1.textures);
return ModelManager0.toUserProfile(texture1.textures);
}
private class UUIDProfile{
@@ -6,7 +6,7 @@ import java.util.Map;
import com.google.gson.Gson;
import customskinloader.CustomSkinLoader;
import customskinloader.ModelManager;
import customskinloader.ModelManager0;
import customskinloader.UserProfile;
import customskinloader.config.SkinSiteProfile;
import customskinloader.utils.HttpUtil0;
@@ -29,7 +29,9 @@ public class UniSkinAPILoader implements IProfileLoader {
if(profile.skins!=null && !profile.skins.isEmpty()){
if(profile.model_preference!=null && !profile.model_preference.isEmpty()){
for(String s:profile.model_preference){
if(ModelManager.checkModel(s)){
if(ModelManager0.checkModel(s)){
if(profile.skins.get(s)==null||profile.skins.get(s).equals(""))
continue;
p.skinUrl=ssp.root+TEXTURES+profile.skins.get(s);
p.model=s;
break;
@@ -44,7 +46,9 @@ public class UniSkinAPILoader implements IProfileLoader {
}
}
}
if(profile.cape!=null && !profile.cape.equals("")){
if(profile.skins.get("cape")!=null && !profile.skins.get("cape").equals("")){
p.capeUrl=ssp.root+TEXTURES+profile.skins.get("cape");
}else if(profile.cape!=null && !profile.cape.equals("")){
p.capeUrl=ssp.root+TEXTURES+profile.cape;
}
if(p.isEmpty()){