From 994a23f96b9ed247fa504486982b5eb64394a297 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 17 Mar 2026 07:44:52 -0700 Subject: [PATCH 1/4] Fix save space indicator display Include space indicator UI element in windows build, logic to handle getting save file sizes on windows --- .../Common/UI/UIScene_LoadOrJoinMenu.cpp | 32 +++++++++++++------ .../Common/UI/UIScene_LoadOrJoinMenu.h | 6 ++-- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp index d73148f5d..d7ad789a1 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.cpp @@ -206,6 +206,8 @@ int UIScene_LoadOrJoinMenu::LoadSaveCallback(LPVOID lpParam,bool bRes) UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) { + constexpr uint64_t MAXIMUM_SAVE_STORAGE = 4LL * 1024LL * 1024LL * 1024LL; + // Setup all the Iggy references we need for this scene initialiseMovie(); app.SetLiveLinkRequired( true ); @@ -230,8 +232,8 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer m_controlJoinTimer.setVisible( true ); -#if defined(_XBOX_ONE) || defined(__ORBIS__) - m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, (4LL *1024LL * 1024LL * 1024LL) ); +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) + m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, MAXIMUM_SAVE_STORAGE); #endif m_bUpdateSaveSize = false; @@ -695,7 +697,7 @@ void UIScene_LoadOrJoinMenu::tick() if(m_eSaveTransferState == eSaveTransfer_Idle) m_bSaveTransferRunning = false; #endif -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) if(m_bUpdateSaveSize) { if((m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC)) @@ -716,7 +718,7 @@ void UIScene_LoadOrJoinMenu::tick() if(m_pSaveDetails!=nullptr) { //CD - Fix - Adding define for ORBIS/XBOXONE -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) m_spaceIndicatorSaves.reset(); #endif @@ -758,6 +760,22 @@ void UIScene_LoadOrJoinMenu::tick() { #if defined(_XBOX_ONE) m_spaceIndicatorSaves.addSave(m_pSaveDetails->SaveInfoA[i].totalSize); +#elif defined(_WINDOWS64) + int origIdx = sortedIdx[i]; + wchar_t wFilename[MAX_SAVEFILENAME_LENGTH]; + ZeroMemory(wFilename, sizeof(wFilename)); + mbstowcs(wFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1); + wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms"); + + HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr); + DWORD fileSize = 0; + + if (hFile != INVALID_HANDLE_VALUE) { + fileSize = GetFileSize(hFile, nullptr); + if (fileSize < 12 || fileSize == INVALID_FILE_SIZE) fileSize = 0; + CloseHandle(hFile); + } + m_spaceIndicatorSaves.addSave(fileSize); #elif defined(__ORBIS__) m_spaceIndicatorSaves.addSave(m_pSaveDetails->SaveInfoA[i].blocksUsed * (32 * 1024) ); #endif @@ -770,12 +788,8 @@ void UIScene_LoadOrJoinMenu::tick() #else #ifdef _WINDOWS64 { - int origIdx = sortedIdx[i]; - wchar_t wFilename[MAX_SAVEFILENAME_LENGTH]; - ZeroMemory(wFilename, sizeof(wFilename)); - mbstowcs(wFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1); - wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms"); wstring levelName = ReadLevelNameFromSaveFile(filePath); + if (!levelName.empty()) { m_buttonListSaves.addItem(levelName, wstring(L"")); diff --git a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.h b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.h index 9f5fe17f3..76a7ed436 100644 --- a/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.h +++ b/Minecraft.Client/Common/UI/UIScene_LoadOrJoinMenu.h @@ -20,7 +20,7 @@ private: { eControl_SavesList, eControl_GamesList, -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) eControl_SpaceIndicator, #endif }; @@ -52,7 +52,7 @@ protected: UIControl_SaveList m_buttonListGames; UIControl_Label m_labelSavesListTitle, m_labelJoinListTitle, m_labelNoGames; UIControl m_controlSavesTimer, m_controlJoinTimer; -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) UIControl_SpaceIndicatorBar m_spaceIndicatorSaves; #endif @@ -68,7 +68,7 @@ private: UI_MAP_ELEMENT( m_controlSavesTimer, "SavesTimer") UI_MAP_ELEMENT( m_controlJoinTimer, "JoinTimer") -#if defined(_XBOX_ONE) || defined(__ORBIS__) +#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64) UI_MAP_ELEMENT( m_spaceIndicatorSaves, "SaveSizeBar") #endif UI_END_MAP_ELEMENTS_AND_NAMES() From ab16f3bf453906d24985a67688a99cf2a8904d8a Mon Sep 17 00:00:00 2001 From: rtm516 Date: Tue, 17 Mar 2026 19:22:24 +0000 Subject: [PATCH 2/4] Change KEY_HOST_SETTINGS back to to VK_TAB --- Minecraft.Client/Windows64/KeyboardMouseInput.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index 2079a72a1..5c406983f 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -34,7 +34,7 @@ public: static const int KEY_DEBUG_MENU = VK_F4; static const int KEY_THIRD_PERSON = VK_F5; static const int KEY_DEBUG_CONSOLE = VK_F6; - static const int KEY_HOST_SETTINGS = VK_F8; + static const int KEY_HOST_SETTINGS = VK_TAB; static const int KEY_FULLSCREEN = VK_F11; // todo: implement and shi From c98153bf07613636f565ebcfa0cda647246d22ba Mon Sep 17 00:00:00 2001 From: Toru the Red Fox Date: Tue, 17 Mar 2026 19:47:34 +0000 Subject: [PATCH 3/4] Fix FOV modification so it respects applyEffects (#1297) --- Minecraft.Client/GameRenderer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/GameRenderer.cpp b/Minecraft.Client/GameRenderer.cpp index 8c9dd5916..4eeccef9e 100644 --- a/Minecraft.Client/GameRenderer.cpp +++ b/Minecraft.Client/GameRenderer.cpp @@ -359,14 +359,17 @@ void GameRenderer::pick(float a) } } +// Toru - wrapping these methods for backwards compatibility, +// no longer setting m_fov as its use doesn't respect applyEffects param in GameRenderer::getFov void GameRenderer::SetFovVal(float fov) { - m_fov=fov; + //m_fov=fov; + mc->options->set(Options::Option::FOV, (fov - 70) / 40); } float GameRenderer::GetFovVal() { - return m_fov; + return 70 + mc->options->fov * 40;//m_fov; } void GameRenderer::tickFov() @@ -392,7 +395,7 @@ float GameRenderer::getFov(float a, bool applyEffects) float fov = m_fov;//70; if (applyEffects) { - //fov += mc->options->fov * 40; + fov += mc->options->fov * 40; fov *= oFov[playerIdx] + (this->fov[playerIdx] - oFov[playerIdx]) * a; } if (player->getHealth() <= 0) From a3ca23fdf6cf1ff4fb5d2f668518403fd50e98b5 Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Tue, 17 Mar 2026 16:15:26 -0500 Subject: [PATCH 4/4] Cleanup project credits and README --- .../Common/UI/UIScene_Credits.cpp | 18 +++ README.md | 114 +++++++++--------- 2 files changed, 75 insertions(+), 57 deletions(-) diff --git a/Minecraft.Client/Common/UI/UIScene_Credits.cpp b/Minecraft.Client/Common/UI/UIScene_Credits.cpp index 9900169ce..73a289faf 100644 --- a/Minecraft.Client/Common/UI/UIScene_Credits.cpp +++ b/Minecraft.Client/Common/UI/UIScene_Credits.cpp @@ -496,6 +496,24 @@ SCreditTextItemDef UIScene_Credits::gs_aCreditDefs[MAX_CREDIT_STRINGS] = { L"are trademarks of Dolby Laboratories.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line #endif #endif + {L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"MinecraftConsoles", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eExtraLargeText}, + {L"Project Maintainers", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText}, + {L"smartcmd", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"codeHusky", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"Patoke", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"rtm516", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"mattsumi", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"dxf", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"la", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"Thank you to our 100+ contributors on GitHub!", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText}, + {L"github.com/smartcmd/MinecraftConsoles", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}, + {L"Additional Thanks", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText}, + {L"notpies - Security Fixes", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText} }; UIScene_Credits::UIScene_Credits(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer) diff --git a/README.md b/README.md index 707b1e6d7..93a0187ed 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ The current goal of MinecraftConsoles is to be a multi-platform base for further See our our [Contributor's Guide](./CONTRIBUTING.md) for more information on the goals of this project. ## Download +### Client Windows users can download our [Nightly Build](https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly)! Simply download the `.zip` file and extract it to a folder where you'd like to keep the game. You can set your username in `username.txt` (you'll have to make this file) - +### Server If you're looking for Dedicated Server software, download its [Nightly Build here](https://github.com/smartcmd/MinecraftConsoles/releases/tag/nightly-dedicated-server). Similar instructions to the client more or less, though see further down in this README for more info on that. ## Platform Support @@ -24,6 +25,7 @@ If you're looking for Dedicated Server software, download its [Nightly Build her ## Features +- Dedicated Server Software (`Minecraft.Server.exe`) - Fixed compilation and execution in both Debug and Release mode on Windows using Visual Studio 2022 - Added support for keyboard and mouse input - Added fullscreen mode support (toggle using F11) @@ -31,7 +33,6 @@ If you're looking for Dedicated Server software, download its [Nightly Build her - Added a high-resolution timer path on Windows for smoother high-FPS gameplay timing - Device's screen resolution will be used as the game resolution instead of using a fixed resolution (1920x1080) - LAN Multiplayer & Discovery -- Dedicated Server Software (`Minecraft.Server.exe`) - Added persistent username system via `username.txt` - Decoupled usernames and UIDs to allow username changes - Fixed various security issues present in the original codebase @@ -63,6 +64,10 @@ If you're looking for Dedicated Server software, download its [Nightly Build her - **Toggle Debug Console**: `F6` + +## Contributors +Would you like to contribute to this project? Please read our [Contributor's Guide](CONTRIBUTING.md) before doing so! This document includes our current goals, standards for inclusions, rules, and more. + ## Client Launch Arguments | Argument | Description | @@ -86,60 +91,8 @@ LAN multiplayer is available on the Windows build - Rename yourself without losing data by keeping your `uid.dat` - Split-screen players can join in, even in Multiplayer -Parts of this feature are based on code from [LCEMP](https://github.com/LCEMP/LCEMP) (thanks!) - # Dedicated Server Software - -## Dedicated Server in Docker (Wine) - -This repository includes a lightweight Docker setup for running the Windows dedicated server under Wine. -### Quick Start (No Build, Recommended) - -No local build is required. The container image is pulled from GHCR. - -```bash -./start-dedicated-server.sh -``` - -`start-dedicated-server.sh` does the following: -- uses `docker-compose.dedicated-server.ghcr.yml` -- pulls latest image, then starts the container - -If you want to skip pulling and just start: - -```bash -./start-dedicated-server.sh --no-pull -``` - -Equivalent manual command: - -```bash -docker compose -f docker-compose.dedicated-server.ghcr.yml up -d -``` - -### Local Build Mode (Optional) - -Use this only when you want to run your own locally built `Minecraft.Server` binary in Docker. -**A local build of `Minecraft.Server` is required for this mode.** - -```bash -docker compose -f docker-compose.dedicated-server.yml up -d --build -``` - -Useful environment variables: -- `XVFB_DISPLAY` (default: `:99`) -- `XVFB_SCREEN` (default: `64x64x16`, tiny virtual display used by Wine) - -Fixed server runtime behavior in container: -- executable path: `/srv/mc/Minecraft.Server.exe` -- bind IP: `0.0.0.0` -- server port: `25565` - -Persistent files are bind-mounted to host: -- `./server-data/server.properties` -> `/srv/mc/server.properties` -- `./server-data/GameHDD` -> `/srv/mc/Windows64/GameHDD` - ## About `server.properties` `Minecraft.Server` reads `server.properties` from the executable working directory (Docker image: `/srv/mc/server.properties`). @@ -199,6 +152,56 @@ Minecraft.Server.exe -name MyServer -port 25565 -ip 0.0.0.0 -maxplayers 8 -logle Minecraft.Server.exe -seed 123456789 ``` +## Dedicated Server in Docker (Wine) + +This repository includes a lightweight Docker setup for running the Windows dedicated server under Wine. +### Quick Start (No Build, Recommended) + +No local build is required. The container image is pulled from GHCR. + +```bash +./start-dedicated-server.sh +``` + +`start-dedicated-server.sh` does the following: +- uses `docker-compose.dedicated-server.ghcr.yml` +- pulls latest image, then starts the container + +If you want to skip pulling and just start: + +```bash +./start-dedicated-server.sh --no-pull +``` + +Equivalent manual command: + +```bash +docker compose -f docker-compose.dedicated-server.ghcr.yml up -d +``` + +### Local Build Mode (Optional) + +Use this only when you want to run your own locally built `Minecraft.Server` binary in Docker. +**A local build of `Minecraft.Server` is required for this mode.** + +```bash +docker compose -f docker-compose.dedicated-server.yml up -d --build +``` + +Useful environment variables: +- `XVFB_DISPLAY` (default: `:99`) +- `XVFB_SCREEN` (default: `64x64x16`, tiny virtual display used by Wine) + +Fixed server runtime behavior in container: +- executable path: `/srv/mc/Minecraft.Server.exe` +- bind IP: `0.0.0.0` +- server port: `25565` + +Persistent files are bind-mounted to host: +- `./server-data/server.properties` -> `/srv/mc/server.properties` +- `./server-data/GameHDD` -> `/srv/mc/Windows64/GameHDD` + + ## Build & Run 1. Install [Visual Studio 2022](https://aka.ms/vs/17/release/vs_community.exe). @@ -216,9 +219,6 @@ cmake --build build --config Debug --target MinecraftClient For more information, see [COMPILE.md](COMPILE.md). -## Contributors -Would you like to contribute to this project? Please read our [Contributor's Guide](CONTRIBUTING.md) before doing so! This document includes our current goals, standards for inclusions, rules, and more. - ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=smartcmd/MinecraftConsoles&type=date&legend=top-left)](https://www.star-history.com/?spm=a2c6h.12873639.article-detail.7.7b9d7fabjNxTRk#smartcmd/MinecraftConsoles&type=date&legend=top-left)