Random Things

Random Things

44M Downloads

[1.12] Crash with item rendering in JEI 4.7.10.99

mezz opened this issue ยท 1 comments

commented

In the latest JEI, I am drawing items to my own buffer instead of using the Tesselator's.
You have some injected code that assumes the Tesselator is running and calls .draw(), which crashes (crash log):

public static void luminousHookPre(int tint)
{
if (luminousItem != null && tint != -1 && luminousItem.shouldGlow(stack, tint))
{
tessellator.draw();
luminousBuffer.begin(7, DefaultVertexFormats.ITEM);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
GlStateManager.disableLighting();
}
}
public static void luminousHookPost()
{
if (luminousItem != null)
{
tessellator.draw();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, backUpX, backUpY);
luminousBuffer.begin(7, DefaultVertexFormats.ITEM);
GlStateManager.enableLighting();
}
}

Please grab the Tesselator's buffer and check if BufferBuilder#isDrawing before stopping it.
I'm also not entirely sure if your rendering will work with JEI's new rendering.
If you switch to use bakedModel.isBuiltInRenderer() it will not go through any of JEI's optimizations.

Normally I would work around this issue on my side, but since you are using assembly here to change the logic in a place that's not normally possible, I hope it's fair to ask for the fix. Thanks!

commented

got the same crash