From 5c5538df2fa8ad6215c2c21419db9f91f9e23646 Mon Sep 17 00:00:00 2001 From: Bigjango13 Date: Sun, 21 Jan 2024 19:00:01 -0500 Subject: [PATCH] Move worldgen desync patch to misc, for LAN games --- mods/src/misc/misc.c | 6 ++++++ mods/src/server/server.cpp | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 35ca47ce..9fc1eba8 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -725,6 +725,12 @@ void init_misc() { // Fix Furnace Visual Bug overwrite_calls((void *) FurnaceTileEntity_getLitProgress, (void *) FurnaceTileEntity_getLitProgress_injection); + // Send the full level, not only changed chunks + unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" + patch((void *) 0x717c4, nop_patch); + unsigned char mov_r3_ff[4] = {0xff, 0x30, 0xa0, 0xe3}; // "mov r3, #0xff" + patch((void *) 0x7178c, mov_r3_ff); + // Init C++ And Logging _init_misc_cpp(); _init_misc_logging(); diff --git a/mods/src/server/server.cpp b/mods/src/server/server.cpp index ad77583c..f07b6a33 100644 --- a/mods/src/server/server.cpp +++ b/mods/src/server/server.cpp @@ -572,11 +572,6 @@ static void server_init() { patch((void *) 0x1685c, player_patch); // Start World On Launch misc_run_on_update(Minecraft_update_injection); - // Send the full level, not only changed chunks - unsigned char nop[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" - patch((void *) 0x717c4, nop); - unsigned char mov_r3_ff[4] = {0xff, 0x30, 0xa0, 0xe3}; // "mov r3, #0xff" - patch((void *) 0x7178c, mov_r3_ff) // Set Max Players unsigned char max_players_patch[4] = {get_max_players(), 0x30, 0xa0, 0xe3}; // "mov r3, #MAX_PLAYERS" patch((void *) 0x166d0, max_players_patch);