Fix incorrect skull texture.

Closes #16
This commit is contained in:
Alexander Xia committed 2016-06-05 17:57:26 +08:00
1 parent 3054cc6a13
commit 946d6901ea
6 files changed
+26 -19

No files matched your search

@@ -170,7 +170,7 @@ public class SkinManager
//CustomSkinLoader Begin (Skull Part)
//return (Map)this.field_152798_f.getUnchecked(p_152788_1_);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(p_152788_1_.getName()):
customskinloader.CustomSkinLoader.loadProfileFromCache(p_152788_1_.getName(),(Map)this.field_152798_f.getUnchecked(p_152788_1_)):
(Map)this.field_152798_f.getUnchecked(p_152788_1_);
//CustomSkinLoader End
}
@@ -172,7 +172,7 @@ public class SkinManager
//return (Map)this.skinCacheLoader.getUnchecked(p_152788_1_);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(p_152788_1_.getName()):
(Map)this.skinCacheLoader.getUnchecked(p_152788_1_);
(Map)this.skinCacheLoader.getUnchecked(p_152788_1_,(Map)this.skinCacheLoader.getUnchecked(p_152788_1_));
//CustomSkinLoader End
}
@@ -163,7 +163,7 @@ public class SkinManager
//CustomSkinLoader Begin (Skull Part)
//return (Map)this.skinCacheLoader.getUnchecked(profile);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(profile.getName()):
customskinloader.CustomSkinLoader.loadProfileFromCache(profile.getName(),this.skinCacheLoader.getUnchecked(profile)):
this.skinCacheLoader.getUnchecked(profile);
//CustomSkinLoader End
}
@@ -16,6 +16,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ImageBufferDownload;
@@ -121,7 +122,7 @@ public class SkinManager
;
}
/*
/*
if (map.isEmpty() && profile.getId().equals(Minecraft.getMinecraft().getSession().getProfile().getId()))
{
profile.getProperties().clear();
@@ -131,11 +132,11 @@ public class SkinManager
//CustomSkinLoader Begin (User Skin/Cape Part)
if(customskinloader.CustomSkinLoader.config.enable){
Map newMap=customskinloader.CustomSkinLoader.loadProfile(profile.getName(), map);
if(!newMap.isEmpty()){
map.clear();
map.putAll(newMap);
}
Map newMap=customskinloader.CustomSkinLoader.loadProfile(profile.getName(), map);
if(!newMap.isEmpty()){
map.clear();
map.putAll(newMap);
}
}
//CustomSkinLoader End
Minecraft.getMinecraft().addScheduledTask(new Runnable()
@@ -159,12 +160,12 @@ public class SkinManager
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile)
{
//CustomSkinLoader Begin (Skull Part)
//return (Map)this.skinCacheLoader.getUnchecked(profile);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(profile.getName()):
this.skinCacheLoader.getUnchecked(profile);
//CustomSkinLoader End
//CustomSkinLoader Begin (Skull Part)
//return (Map)this.skinCacheLoader.getUnchecked(profile);
return (customskinloader.CustomSkinLoader.config.enable && customskinloader.CustomSkinLoader.config.enableSkull)?
customskinloader.CustomSkinLoader.loadProfileFromCache(profile.getName(),this.skinCacheLoader.getUnchecked(profile)):
this.skinCacheLoader.getUnchecked(profile);
//CustomSkinLoader End
}
public interface SkinAvailableCallback
+2
View File
@@ -1,6 +1,8 @@
@echo off
SET MC_VERSION=1.9.2
SET CSL_VERSION=13.7a
title CustomSkinLoader_%MC_VERSION%-%CSL_VERSION%
echo !!!CustomSkinLoader for %MC_VERSION% will not be updated.!!!
cd src
javac -source 1.6 -target 1.6 -d ../bin -cp ;../lib/commons-codec-1.9.jar;../lib/commons-io-2.4.jar;../lib/gson-2.2.4.jar;../lib/guava-17.0.jar;../lib/authlib-1.5.22.jar;../%MC_VERSION%.jar *.java
javac -source 1.6 -target 1.6 -d ../bin -cp ;../lib/commons-io-2.4.jar;../lib/launchwrapper-1.7.jar customskinloader/tweaker/*.java
@@ -28,10 +28,10 @@ import customskinloader.utils.MinecraftUtil;
/**
* Custom skin loader mod for Minecraft.
* @author (C) Jeremy Lam [JLChnToZ] 2013 & Alexander Xia [xfl03] 2014-2016
* @version 13.7 (2016.5.7)
* @version 13.8 (2016.6.5)
*/
public class CustomSkinLoader {
public static final String CustomSkinLoader_VERSION="13.7";
public static final String CustomSkinLoader_VERSION="13.8";
public static final File DATA_DIR=new File(MinecraftUtil.getMinecraftDataDir0(),"CustomSkinLoader"),
LOG_FILE=new File(DATA_DIR,"CustomSkinLoader.log"),
CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json");
@@ -96,8 +96,9 @@ public class CustomSkinLoader {
logger.info(username+"'s profile not found.");
return defaultProfile;
}
//For Skull
public static Map<Type, MinecraftProfileTexture> loadProfileFromCache(final String username) {
public static Map<Type, MinecraftProfileTexture> loadProfileFromCache(final String username,final Map defaultProfile) {
if(profileCache.containsKey(username)){
UserProfile profile=profileCache.get(username);
return ModelManager0.fromUserProfile(profile);
@@ -105,13 +106,16 @@ public class CustomSkinLoader {
profileCache.put(username, null);
Thread loadThread=new Thread(){
public void run(){
loadProfile(username,(UserProfile)null);//Load in thread
loadProfile(username,ModelManager0.toUserProfile(defaultProfile));//Load in thread
}
};
loadThread.setName(username+"'s skull");
loadThread.start();
return Maps.newHashMap();
}
public static Map<Type, MinecraftProfileTexture> loadProfileFromCache(final String username) {
return loadProfileFromCache(username,null);
}
private static Logger initLogger() {
Logger logger=new Logger(LOG_FILE);