Fix recipe tooltip lighting (#757)

This commit is contained in:
sisyphussy authored and GitHub committed 2025-10-14 17:09:02 +03:00
1 parent e13401ded8
commit d47417302e
3 files changed
+8 -5

No files matched your search

@@ -107,7 +107,7 @@ public class ItemsTooltipLineHandler implements ITooltipLineHandler {
final int xTranslation = x;
final int yTranslation = y + fontRenderer.FONT_HEIGHT + 2;
final int zTranslation = 400;
final int zTranslation = GuiContainerManager.TOOLTIP_Z_OFFSET;
GL11.glTranslatef(xTranslation, yTranslation, zTranslation);
int indexShift = 0;
@@ -82,6 +82,9 @@ public class GuiContainerManager {
public static final LinkedList<IContainerSlotClickHandler> slotClickHandlers = new HideousLinkedList<>(
new CopyOnWriteArrayList<>());
// Any item rendered with this z offset should render it on top of every other gui element
public static final int TOOLTIP_Z_OFFSET = 400;
static {
addSlotClickHandler(new DefaultSlotClickHandler());
}
@@ -80,10 +80,10 @@ public class RecipeTooltipLineHandler implements ITooltipLineHandler {
final Dimension size = getSize();
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT | GL11.GL_LIGHTING_BIT);
GL11.glTranslatef(x, y, 0);
GL11.glScaled(1, 1, 3);
final int zTranslation = GuiContainerManager.TOOLTIP_Z_OFFSET;
GL11.glTranslatef(x, y, zTranslation);
GuiContainerManager.enable2DRender();
GL11.glColor4f(1, 1, 1, 1);
@@ -103,7 +103,7 @@ public class RecipeTooltipLineHandler implements ITooltipLineHandler {
() -> { this.widget.draw(0, 0); });
GL11.glPopAttrib();
GL11.glPopMatrix();
GL11.glTranslatef(-x, -y, -zTranslation);
}
}