Can't call this from a background thread, only the main one.

This commit is contained in:
Sollace 2019-07-06 21:48:27 +02:00
parent 0138938da3
commit 75f60a0185

View file

@ -100,6 +100,9 @@ public class Pony implements IPony {
MinecraftClient mc = MinecraftClient.getInstance(); MinecraftClient mc = MinecraftClient.getInstance();
TextureManager textures = mc.getTextureManager(); TextureManager textures = mc.getTextureManager();
if (!mc.isOnThread()) {
throw new RuntimeException("This can only be called from the main thread.");
}
// recreate NativeImage from the GL matrix // recreate NativeImage from the GL matrix
textures.bindTexture(resource); textures.bindTexture(resource);