Merge pull request #201 from realffqq/feat/restore-java-gui
Some checks are pending
Build (Linux, x86_64) / build-linux (push) Waiting to run
Build (Linux, x86_64) / build-linux-debug (push) Waiting to run

(feat/restore-java-gui)fix: reorder and correct lighting for blocks in container screens
This commit is contained in:
Leah Anderson 2026-03-12 07:53:47 -06:00 committed by GitHub
commit 316577484f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -342,9 +342,11 @@ void ItemRenderer::renderGuiItem(Font *font, Textures *textures, std::shared_ptr
Tile *tile = Tile::tiles[itemId];
glPushMatrix();
// 4J - original code left here for reference
#if 0
// 4jcraft: re-enable said original code to fix hotbar block rendering
#if 1
glTranslatef((float)(x), (float)(y), 0.0f);
glScalef(fScale, fScale, fScale);
//glScalef(fScale, fScale, fScale);
glScalef(fScaleX, fScaleY, 1.0f); // 4jcraft: tweaked to use the new variables
glTranslatef(-2.0f,3.0f, -3.0f + blitOffset);
glScalef(10.0f, 10.0f, 10.0f);
glTranslatef(1.0f, 0.5f, 8.0f);

View file

@ -1763,7 +1763,8 @@ void GameRenderer::renderSnowAndRain(float a)
t->color(br, br, br, ((1 - dd * dd) * 0.5f + 0.5f) * rainLevel);
t->vertexUV(x - xa + 0.5, yy0, z - za + 0.5, 0 * s, yy0 * s / 4.0f + ra * s);
t->vertexUV(x + xa + 0.5, yy0, z + za + 0.5, 1 * s, yy0 * s / 4.0f + ra * s);
t->color(br, br, br, 0.0f); // 4J - added to soften the top visible edge of the rain
// 4jcraft: this color call made rain invisible
// t->color(br, br, br, 0.0f); // 4J - added to soften the top visible edge of the rain
t->vertexUV(x + xa + 0.5, yy1, z + za + 0.5, 1 * s, yy1 * s / 4.0f + ra * s);
t->vertexUV(x - xa + 0.5, yy1, z - za + 0.5, 0 * s, yy1 * s / 4.0f + ra * s);
#endif

View file

@ -42,7 +42,6 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
glPushMatrix();
glRotatef(120, 1, 0, 0);
Lighting::turnOn();
glPopMatrix();
glPushMatrix();
@ -50,6 +49,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
glColor4f(1, 1, 1, 1);
glEnable(GL_RESCALE_NORMAL);
Lighting::turnOnGui();
Slot *hoveredSlot = NULL;
@ -85,8 +85,8 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
itemRenderer->renderGuiItemDecorations(font, minecraft->textures, inventory->getCarried(), xm - xo - 8, ym - yo - 8);
// carriedSlot = old;
}
glDisable(GL_RESCALE_NORMAL);
Lighting::turnOff();
glDisable(GL_RESCALE_NORMAL);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);