Support 1.12.1

This commit is contained in:
Alexander Xia committed 2017-08-13 20:48:18 +08:00
1 parent 32547481e7
commit a49fea706d
8 files changed
+109 -10

No files matched your search

+2 -2
View File
@@ -2,5 +2,5 @@ minecraft_version=1.11.2
minecraft_full_versions=1.11.1,1.11.2
#forge gradle needs forge version
forge_mc_version=1.11.2
forge_version=13.20.0.2228
mappings_version=snapshot_20170106
forge_version=13.20.1.2386
mappings_version=stable_32
@@ -2,5 +2,5 @@ minecraft_version=1.12
minecraft_full_versions=1.12
#forge gradle needs forge version
forge_mc_version=1.12
forge_version=14.21.0.2321
mappings_version=snapshot_20170106
forge_version=14.21.1.2387
mappings_version=snapshot_20170813
@@ -25,7 +25,6 @@ import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
//From 1.11.2-mcp937
public class SkinManager
{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
+6
View File
@@ -0,0 +1,6 @@
minecraft_version=1.12.1
minecraft_full_versions=1.12.1
#forge gradle needs forge version
forge_mc_version=1.12.1
forge_version=14.22.0.2452
mappings_version=snapshot_20170813
@@ -0,0 +1,91 @@
package net.minecraft.client.resources;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.InsecureTextureException;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.IImageBuffer;
import net.minecraft.client.renderer.ImageBufferDownload;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
//From 1.12-mcp940
public class SkinManager
{
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(0, 2, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue());
private final TextureManager textureManager;
private final File skinCacheDir;
private final MinecraftSessionService sessionService;
private final LoadingCache<GameProfile, Map<Type, MinecraftProfileTexture>> skinCacheLoader;
private customskinloader.fake.FakeSkinManager fakeManager;//Fake Skin Manager
public SkinManager(TextureManager textureManagerInstance, File skinCacheDirectory, MinecraftSessionService sessionService)
{
this.textureManager = textureManagerInstance;
this.skinCacheDir = skinCacheDirectory;
this.sessionService = sessionService;
this.skinCacheLoader = CacheBuilder.newBuilder().expireAfterAccess(15L, TimeUnit.SECONDS).<GameProfile, Map<Type, MinecraftProfileTexture>>build(new CacheLoader<GameProfile, Map<Type, MinecraftProfileTexture>>()
{
public Map<Type, MinecraftProfileTexture> load(GameProfile p_load_1_) throws Exception
{
try
{
return Minecraft.getMinecraft().getSessionService().getTextures(p_load_1_, false);
}
catch (Throwable var3)
{
return Maps.<Type, MinecraftProfileTexture>newHashMap();
}
}
});
this.fakeManager=new customskinloader.fake.FakeSkinManager(textureManagerInstance,skinCacheDirectory,sessionService);
}
/**
* Used in the Skull renderer to fetch a skin. May download the skin if it's not in the cache
*/
public ResourceLocation loadSkin(MinecraftProfileTexture profileTexture, Type textureType)
{
return this.loadSkin(profileTexture, textureType, (SkinManager.SkinAvailableCallback)null);
}
/**
* May download the skin if its not in the cache, can be passed a SkinManager#SkinAvailableCallback for handling
*/
public ResourceLocation loadSkin(final MinecraftProfileTexture profileTexture, final Type textureType, @Nullable final SkinManager.SkinAvailableCallback skinAvailableCallback)
{
return this.fakeManager.loadSkin(profileTexture, textureType, skinAvailableCallback);
}
public void loadProfileTextures(final GameProfile profile, final SkinManager.SkinAvailableCallback skinAvailableCallback, final boolean requireSecure)
{
this.fakeManager.loadProfileTextures(profile, skinAvailableCallback, requireSecure);
}
public Map<Type, MinecraftProfileTexture> loadSkinFromCache(GameProfile profile)
{
return this.fakeManager.loadSkinFromCache(profile);
}
public interface SkinAvailableCallback
{
void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture);
}
}
@@ -33,8 +33,10 @@ public class CustomSkinLoader {
CONFIG_FILE=new File(DATA_DIR,"CustomSkinLoader.json");
public static final SkinSiteProfile[] DEFAULT_LOAD_LIST={
SkinSiteProfile.createMojangAPI("Mojang"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://123.57.132.134/"),
SkinSiteProfile.createCustomSkinAPI("OneSkin","http://fleey.cn/skin/skin_user/skin_json.php/"),
SkinSiteProfile.createCustomSkinAPI("LittleSkin","https://mcskin.littleservice.cn/"),
SkinSiteProfile.createCustomSkinAPI("BlessingSkin","http://skin.prinzeugen.net/"),
//OneSkin has been removed temporarily
//SkinSiteProfile.createCustomSkinAPI("OneSkin","http://fleey.cn/skin/skin_user/skin_json.php/"),
//Minecrack could not load skin correctly
//SkinSiteProfile.creatLegacy("Minecrack","http://minecrack.fr.nf/mc/skinsminecrackd/{USERNAME}.png","http://minecrack.fr.nf/mc/cloaksminecrackd/{USERNAME}.png",null),
SkinSiteProfile.createUniSkinAPI("SkinMe","http://www.skinme.cc/uniskin/"),
+2 -2
View File
@@ -50,8 +50,8 @@ The problem of rendering incorrect texture has been fixed.
## Default Load List
- [Mojang](http://www.minecraft.net/) (Mojang API)
- [Blessing Skin](http://123.57.132.134/) (CustomSkinAPI)
- [OneSkin](http://fleey.cn/skin/) (CustomSkinAPI)
- [Little Skin](https://mcskin.littleservice.cn/) (CustomSkinAPI)
- [Blessing Skin](http://skin.prinzeugen.net/) (CustomSkinAPI)
- SkinMe (UniSkinAPI)
- LocalSkin (Legacy)
If you want to apply to add other skin server to default list, please go to [issue](https://github.com/JLChnToZ/MCCustomSkinLoader/issues).
+2 -1
View File
@@ -4,7 +4,8 @@ include "1.9-mcp924"
include "1.9.4-mcp928"
include "1.10-mcp931"
include "1.11.2-mcp937"
include "1.12-test"
include "1.12-mcp940"
include "1.12.1-test"
//Universial Forge Version for [1.8,)
include "Forge"