mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Fix hd skin loading
This commit is contained in:
parent
4648732b24
commit
bf5b141687
4 changed files with 25 additions and 5 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
19
src/hdskins/java/com/voxelmodpack/hdskins/TextureLoader.java
Normal file
19
src/hdskins/java/com/voxelmodpack/hdskins/TextureLoader.java
Normal 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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue