Merge pull request #193 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: add proper head movement to player inventory preview
This commit is contained in:
DecalOverdose 2026-03-12 03:11:34 +04:00 committed by GitHub
commit bcc2bf42f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,6 +58,8 @@ void InventoryScreen::renderBg(float a)
float oybr = minecraft->player->yBodyRot;
float oyr = minecraft->player->yRot;
float oxr = minecraft->player->xRot;
float oyh = minecraft->player->yHeadRot;
float oyhp = minecraft->player->yHeadRotO;
float xd = (xo + 51) - xMouse;
float yd = (yo + 75 - 50) - yMouse;
@ -71,12 +73,16 @@ void InventoryScreen::renderBg(float a)
minecraft->player->yBodyRot = (float) atan(xd / 40.0f) * 20;
minecraft->player->yRot = (float) atan(xd / 40.0f) * 40;
minecraft->player->xRot = -(float) atan(yd / 40.0f) * 20;
minecraft->player->yHeadRot = (float) atan(xd / 40.0f) * 40;
minecraft->player->yHeadRotO = (float) atan(xd / 40.0f) * 40;
glTranslatef(0, minecraft->player->heightOffset, 0);
EntityRenderDispatcher::instance->playerRotY = 180;
EntityRenderDispatcher::instance->render(minecraft->player, 0, 0, 0, 0, 1);
minecraft->player->yBodyRot = oybr;
minecraft->player->yRot = oyr;
minecraft->player->xRot = oxr;
minecraft->player->yHeadRot = oyh;
minecraft->player->yHeadRotO = oyhp;
glPopMatrix();
Lighting::turnOff();
glDisable(GL_RESCALE_NORMAL);