From 7c578c216167e22f2f80fd42f77ede8af40a4335 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:49:26 -0600 Subject: [PATCH 1/6] feat: stub `QueryPerformance{Counter, Frequency}` --- Minecraft.Client/Linux/LinuxStubs.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Minecraft.Client/Linux/LinuxStubs.h b/Minecraft.Client/Linux/LinuxStubs.h index 2e16db67d..31273cac8 100644 --- a/Minecraft.Client/Linux/LinuxStubs.h +++ b/Minecraft.Client/Linux/LinuxStubs.h @@ -520,4 +520,21 @@ static inline BOOL FindClose(HANDLE hFindFile) return TRUE; } +BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +{ + // nanoseconds + lpFrequency->QuadPart = (1000000000); + return false; +} + +static inline BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) +{ + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + + lpPerformanceCount->QuadPart = (ts.tv_sec * 1000000000LL) + ts.tv_nsec; + + return true; +} + #endif // LINUXSTUBS_H \ No newline at end of file From 5d5e4b44189ecc1a84706694e8f13d30cd6ebb6c Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:53:45 -0600 Subject: [PATCH 2/6] feat: implement `GetTickCount` --- Minecraft.Client/Linux/LinuxStubs.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Minecraft.Client/Linux/LinuxStubs.h b/Minecraft.Client/Linux/LinuxStubs.h index 31273cac8..0987180b9 100644 --- a/Minecraft.Client/Linux/LinuxStubs.h +++ b/Minecraft.Client/Linux/LinuxStubs.h @@ -520,21 +520,34 @@ static inline BOOL FindClose(HANDLE hFindFile) return TRUE; } -BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) +static inline DWORD GetTickCount() +{ + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + + // milliseconds + return (long long)ts.tv_sec * 1000 + (long long)ts.tv_nsec / 1000000; +} + +static inline BOOL QueryPerformanceFrequency(LARGE_INTEGER *lpFrequency) { // nanoseconds - lpFrequency->QuadPart = (1000000000); + lpFrequency->QuadPart = 1000000000; return false; } + static inline BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); - lpPerformanceCount->QuadPart = (ts.tv_sec * 1000000000LL) + ts.tv_nsec; + // nanoseconds + lpPerformanceCount->QuadPart = ((long long)ts.tv_sec * 1000000000) + (long long)ts.tv_nsec; return true; } + + #endif // LINUXSTUBS_H \ No newline at end of file From a2107c6ab5b201a5a71f636802731eb1736564c8 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:58:40 -0600 Subject: [PATCH 3/6] fix: add missing `climits`/`cfloat` includes --- Minecraft.Client/Linux/LinuxStubs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Minecraft.Client/Linux/LinuxStubs.h b/Minecraft.Client/Linux/LinuxStubs.h index 0987180b9..4af8de6d8 100644 --- a/Minecraft.Client/Linux/LinuxStubs.h +++ b/Minecraft.Client/Linux/LinuxStubs.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include #include #include From 300b1ff8412a228e9b3742affdf95821560ad7e6 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:01:56 -0600 Subject: [PATCH 4/6] fix: more miscapitalized includes --- Minecraft.World/Path.cpp | 2 +- Minecraft.World/WoodSlabTile.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Minecraft.World/Path.cpp b/Minecraft.World/Path.cpp index 538917f6f..ff8a641ad 100644 --- a/Minecraft.World/Path.cpp +++ b/Minecraft.World/Path.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "net.minecraft.world.entity.h" #include "net.minecraft.world.level.pathfinder.h" -#include "path.h" +#include "Path.h" Path::~Path() { diff --git a/Minecraft.World/WoodSlabTile.cpp b/Minecraft.World/WoodSlabTile.cpp index ba3a98e50..d7a0e9e10 100644 --- a/Minecraft.World/WoodSlabTile.cpp +++ b/Minecraft.World/WoodSlabTile.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "WoodSlabTile.h" -#include "woodtile.h" -#include "treetile.h" +#include "WoodTile.h" +#include "TreeTile.h" #include "net.minecraft.world.level.h" #include "net.minecraft.world.level.biome.h" #include "net.minecraft.world.item.h" From 55964caf95b5e8ea889a253e2187f6a2a81c0d5b Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:09:49 -0600 Subject: [PATCH 5/6] feat: direct `OutputDebugString` functions to stderr --- Minecraft.Client/Linux/LinuxStubs.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Minecraft.Client/Linux/LinuxStubs.h b/Minecraft.Client/Linux/LinuxStubs.h index 4af8de6d8..e153d0de8 100644 --- a/Minecraft.Client/Linux/LinuxStubs.h +++ b/Minecraft.Client/Linux/LinuxStubs.h @@ -550,6 +550,21 @@ static inline BOOL QueryPerformanceCounter(LARGE_INTEGER *lpPerformanceCount) return true; } +#ifndef _FINAL_BUILD +VOID OutputDebugStringW(LPCWSTR lpOutputString) +{ + fwprintf(stderr, lpOutputString); +} +VOID OutputDebugString(LPCSTR lpOutputString) +{ + fprintf(stderr, lpOutputString); +} + +VOID OutputDebugStringA(LPCSTR lpOutputString) +{ + fprintf(stderr, lpOutputString); +} +#endif // _CONTENT_PACKAGE #endif // LINUXSTUBS_H \ No newline at end of file From e3b63aa6903a12fabe5bb8200ea14a7bebd45e01 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:14:31 -0600 Subject: [PATCH 6/6] fix: add missing winerror macro definitions --- Minecraft.Client/Linux/LinuxStubs.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Minecraft.Client/Linux/LinuxStubs.h b/Minecraft.Client/Linux/LinuxStubs.h index e153d0de8..ffc7be279 100644 --- a/Minecraft.Client/Linux/LinuxStubs.h +++ b/Minecraft.Client/Linux/LinuxStubs.h @@ -67,6 +67,12 @@ typedef unsigned char byte; typedef short SHORT; typedef float FLOAT; +#define ERROR_SUCCESS 0L +#define ERROR_IO_PENDING 997L // dderror +#define ERROR_CANCELLED 1223L +//#define S_OK ((HRESULT)0x00000000L) +#define S_FALSE ((HRESULT)0x00000001L) + #define PAGE_READWRITE 0x04 #define MEM_LARGE_PAGES 0x20000000 #define MAXULONG_PTR ((ULONG_PTR)~0UL)