Merge branch 'dev' into feat/restore-java-gui

This commit is contained in:
Sally Knight
2026-03-16 16:04:30 +03:00
2244 changed files with 191481 additions and 186843 deletions

View File

@@ -10,34 +10,29 @@
#include "StatsScreen.h"
#include "../../../Minecraft.World/Headers/net.minecraft.stats.h"
InventoryScreen::InventoryScreen(std::shared_ptr<Player> player) : AbstractContainerScreen(player->inventoryMenu)
{
xMouse = yMouse = 0.0f; // 4J added
InventoryScreen::InventoryScreen(std::shared_ptr<Player> player)
: AbstractContainerScreen(player->inventoryMenu) {
xMouse = yMouse = 0.0f; // 4J added
this->passEvents = true;
player->awardStat(GenericStats::openInventory(), GenericStats::param_noArgs());
player->awardStat(GenericStats::openInventory(),
GenericStats::param_noArgs());
}
void InventoryScreen::init()
{
buttons.clear();
void InventoryScreen::init() { buttons.clear(); }
void InventoryScreen::renderLabels() {
font->draw(L"Crafting", 84 + 2, 8 * 2, 0x404040);
}
void InventoryScreen::renderLabels()
{
font->draw(L"Crafting", 84 + 2, 8 * 2, 0x404040);
}
void InventoryScreen::render(int xm, int ym, float a)
{
void InventoryScreen::render(int xm, int ym, float a) {
AbstractContainerScreen::render(xm, ym, a);
this->xMouse = (float)xm;
this->yMouse = (float)ym;
}
void InventoryScreen::renderBg(float a)
{
// 4J Unused
void InventoryScreen::renderBg(float a) {
// 4J Unused
#ifdef ENABLE_JAVA_GUIS
int tex = minecraft->textures->loadTexture(TN_GUI_INVENTORY);
glColor4f(1, 1, 1, 1);
@@ -68,13 +63,13 @@ void InventoryScreen::renderBg(float a)
Lighting::turnOn();
glRotatef(-45 - 90, 0, 1, 0);
glRotatef(-(float) atan(yd / 40.0f) * 20, 1, 0, 0);
glRotatef(-(float)atan(yd / 40.0f) * 20, 1, 0, 0);
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;
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);
@@ -89,14 +84,13 @@ void InventoryScreen::renderBg(float a)
#endif
}
void InventoryScreen::buttonClicked(Button *button)
{
if (button->id == 0)
{
minecraft->setScreen(new AchievementScreen(minecraft->stats[minecraft->player->GetXboxPad()]));
void InventoryScreen::buttonClicked(Button* button) {
if (button->id == 0) {
minecraft->setScreen(new AchievementScreen(
minecraft->stats[minecraft->player->GetXboxPad()]));
}
if (button->id == 1)
{
minecraft->setScreen(new StatsScreen(this, minecraft->stats[minecraft->player->GetXboxPad()]));
if (button->id == 1) {
minecraft->setScreen(new StatsScreen(
this, minecraft->stats[minecraft->player->GetXboxPad()]));
}
}