mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-28 13:36:05 +00:00
Remove Tab
This commit is contained in:
1 parent
4449ccdd45
commit
c40bb38e20
38 files changed
+2331
-2317
No files matched your search
@@ -20,59 +20,59 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StringUtils;
|
||||
|
||||
public class FakeClientPlayer {
|
||||
//For Legacy Skin
|
||||
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username)
|
||||
{
|
||||
//CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username);
|
||||
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
|
||||
ITextureObject ito = textman.getTexture(resourceLocationIn);
|
||||
//For Legacy Skin
|
||||
public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation resourceLocationIn, String username)
|
||||
{
|
||||
//CustomSkinLoader.logger.debug("FakeClientPlayer/getDownloadImageSkin "+username);
|
||||
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
|
||||
ITextureObject ito = textman.getTexture(resourceLocationIn);
|
||||
|
||||
if (ito == null || !(ito instanceof ThreadDownloadImageData))
|
||||
{
|
||||
//if Legacy Skin for username not loaded yet
|
||||
SkinManager skinman = Minecraft.getMinecraft().getSkinManager();
|
||||
UUID offlineUUID=EntityPlayer.getOfflineUUID(username);
|
||||
GameProfile offlineProfile=new GameProfile(offlineUUID,username);
|
||||
|
||||
//Load Default Skin
|
||||
ResourceLocation defaultSkin=DefaultPlayerSkin.getDefaultSkin(offlineUUID);
|
||||
ITextureObject defaultSkinObj=new SimpleTexture(defaultSkin);
|
||||
textman.loadTexture(resourceLocationIn, defaultSkinObj);
|
||||
|
||||
//Load Skin from SkinManager
|
||||
skinman.loadProfileTextures(offlineProfile, new LegacyBuffer(resourceLocationIn), false);
|
||||
}
|
||||
if (ito == null || !(ito instanceof ThreadDownloadImageData))
|
||||
{
|
||||
//if Legacy Skin for username not loaded yet
|
||||
SkinManager skinman = Minecraft.getMinecraft().getSkinManager();
|
||||
UUID offlineUUID=EntityPlayer.getOfflineUUID(username);
|
||||
GameProfile offlineProfile=new GameProfile(offlineUUID,username);
|
||||
|
||||
//Load Default Skin
|
||||
ResourceLocation defaultSkin=DefaultPlayerSkin.getDefaultSkin(offlineUUID);
|
||||
ITextureObject defaultSkinObj=new SimpleTexture(defaultSkin);
|
||||
textman.loadTexture(resourceLocationIn, defaultSkinObj);
|
||||
|
||||
//Load Skin from SkinManager
|
||||
skinman.loadProfileTextures(offlineProfile, new LegacyBuffer(resourceLocationIn), false);
|
||||
}
|
||||
|
||||
if(ito instanceof ThreadDownloadImageData)
|
||||
return (ThreadDownloadImageData)ito;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
if(ito instanceof ThreadDownloadImageData)
|
||||
return (ThreadDownloadImageData)ito;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ResourceLocation getLocationSkin(String username)
|
||||
{
|
||||
//CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username);
|
||||
return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username));
|
||||
}
|
||||
|
||||
private static class LegacyBuffer implements SkinAvailableCallback{
|
||||
ResourceLocation resourceLocationIn;
|
||||
|
||||
public LegacyBuffer(ResourceLocation resourceLocationIn) {
|
||||
CustomSkinLoader.logger.debug("Loading Legacy Texture "+resourceLocationIn);
|
||||
this.resourceLocationIn=resourceLocationIn;
|
||||
}
|
||||
public static ResourceLocation getLocationSkin(String username)
|
||||
{
|
||||
//CustomSkinLoader.logger.debug("FakeClientPlayer/getLocationSkin "+username);
|
||||
return new ResourceLocation("skins/legacy-" + StringUtils.stripControlCodes(username));
|
||||
}
|
||||
|
||||
private static class LegacyBuffer implements SkinAvailableCallback{
|
||||
ResourceLocation resourceLocationIn;
|
||||
|
||||
public LegacyBuffer(ResourceLocation resourceLocationIn) {
|
||||
CustomSkinLoader.logger.debug("Loading Legacy Texture "+resourceLocationIn);
|
||||
this.resourceLocationIn=resourceLocationIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
|
||||
if(typeIn!=Type.SKIN)
|
||||
return;
|
||||
CustomSkinLoader.logger.debug("Legacy Texture Loaded "+resourceLocationIn);
|
||||
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
|
||||
ITextureObject ito = textman.getTexture(location);
|
||||
textman.loadTexture(resourceLocationIn, ito);
|
||||
//textman.bindTexture(resourceLocationIn);
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public void skinAvailable(Type typeIn, ResourceLocation location, MinecraftProfileTexture profileTexture) {
|
||||
if(typeIn!=Type.SKIN)
|
||||
return;
|
||||
CustomSkinLoader.logger.debug("Legacy Texture Loaded "+resourceLocationIn);
|
||||
TextureManager textman = Minecraft.getMinecraft().getTextureManager();
|
||||
ITextureObject ito = textman.getTexture(location);
|
||||
textman.loadTexture(resourceLocationIn, ito);
|
||||
//textman.bindTexture(resourceLocationIn);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user