Fix hd skin loading

This commit is contained in:
Matthew Messinger 2016-11-14 00:38:24 -05:00
parent 4648732b24
commit bf5b141687
4 changed files with 25 additions and 5 deletions

View file

@ -26,7 +26,7 @@ apply plugin: 'org.spongepowered.mixin'
apply plugin: 'mnm.gradle.ap-ide'
group = 'com.brohoof.minelp'
version = '1.10.2.5'
version = '1.10.2.6'
description = 'Mine Little Pony'
minecraft {

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Sat Nov 12 03:22:49 EST 2016
build.number=254
#Mon Nov 14 00:39:19 EST 2016
build.number=255

View file

@ -153,7 +153,8 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
}
});
Minecraft.getMinecraft().getTextureManager().loadTexture(skin, threaddownloadimagedata);
// schedule texture loading on the main thread.
TextureLoader.loadTexture(skin, threaddownloadimagedata);
}
}
@ -246,7 +247,7 @@ public final class HDSkinManager implements IResourceManagerReloadListener {
if (skin != null) {
String url = INSTANCE.getCustomTextureURLForId(Type.SKIN, UUIDTypeAdapter.fromUUID(profile.getId()), true);
skinTexture = new PreviewTexture(url, DefaultPlayerSkin.getDefaultSkin(profile.getId()), new ImageBufferDownloadHD());
textureManager.loadTexture(skinResource, skinTexture);
TextureLoader.loadTexture(skinResource, skinTexture);
}
return (PreviewTexture) skinTexture;

View file

@ -0,0 +1,19 @@
package com.voxelmodpack.hdskins;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.ITextureObject;
import net.minecraft.util.ResourceLocation;
public class TextureLoader {
private static Minecraft mc = Minecraft.getMinecraft();
public static void loadTexture(final ResourceLocation textureLocation, final ITextureObject textureObj) {
mc.addScheduledTask(new Runnable() {
@Override
public void run() {
mc.getTextureManager().loadTexture(textureLocation, textureObj);
}
});
}
}