From 45b93534fad42cdea5d6bbcdcdf7e680354c6e88 Mon Sep 17 00:00:00 2001 From: TheBrokenRail Date: Sat, 25 Feb 2023 19:36:35 -0500 Subject: [PATCH] Revert "Add Night Vision" This reverts commit 5273d6cdf9007058c2545a86ea7da405e54e15c7. --- launcher/src/client/available-feature-flags | 1 - mods/src/misc/misc.c | 11 ----------- symbols/include/symbols/minecraft.h | 14 +++----------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/launcher/src/client/available-feature-flags b/launcher/src/client/available-feature-flags index 7c7a72cc..e9876387 100644 --- a/launcher/src/client/available-feature-flags +++ b/launcher/src/client/available-feature-flags @@ -46,4 +46,3 @@ FALSE Disable Speed Bridging FALSE Disable Creative Mode Mining Delay FALSE Add Biome Colors To Grass TRUE Generate Caves -FALSE Night Vision diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 5d49fce9..1bc8d6a9 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -390,11 +390,6 @@ static void RandomLevelSource_buildSurface_injection(unsigned char *random_level (*LargeCaveFeature_apply)(cave_feature, random_level_source, level, chunk_x, chunk_y, chunk_data, 0); } -// Night Vision -static float LevelSource_getBrightness_injection(__attribute__((unused)) unsigned char *level_source, __attribute__((unused)) int32_t x, __attribute__((unused)) int32_t y, __attribute__((unused)) int32_t z) { - return 1.0f; -} - // Init static void nop() { } @@ -511,12 +506,6 @@ void init_misc() { overwrite_calls((void *) RandomLevelSource_buildSurface, (void *) RandomLevelSource_buildSurface_injection); } - // Night Vision - if (feature_has("Night Vision", server_disabled)) { - overwrite((void *) Level_getBrightness, (void *) LevelSource_getBrightness_injection); - overwrite((void *) Region_getBrightness, (void *) LevelSource_getBrightness_injection); - } - // Init C++ And Logging _init_misc_cpp(); _init_misc_logging(); diff --git a/symbols/include/symbols/minecraft.h b/symbols/include/symbols/minecraft.h index fa418430..b611ed54 100644 --- a/symbols/include/symbols/minecraft.h +++ b/symbols/include/symbols/minecraft.h @@ -501,13 +501,6 @@ static void *SurvivalMode = (void *) 0x1b7d8; typedef uint32_t (*LevelData_getSpawnMobs_t)(unsigned char *level_data); static LevelData_getSpawnMobs_t LevelData_getSpawnMobs = (LevelData_getSpawnMobs_t) 0xbabec; -// LevelSource - -typedef unsigned char *(*LevelSource_getBiome_t)(unsigned char *level_source, int32_t x, int32_t z); -static uint32_t LevelSource_getBiome_vtable_offset = 0x24; - -typedef float (*LevelSource_getBrightness_t)(unsigned char *level_source, int32_t x, int32_t y, int32_t z); - // Level typedef void (*Level_saveLevelData_t)(unsigned char *level); @@ -525,13 +518,12 @@ static Level_getMaterial_t Level_getMaterial = (Level_getMaterial_t) 0xa27f8; typedef HitResult (*Level_clip_t)(unsigned char *level, unsigned char *param_1, unsigned char *param_2, bool clip_liquids, bool param_3); static Level_clip_t Level_clip = (Level_clip_t) 0xa3db0; -static LevelSource_getBrightness_t Level_getBrightness = (LevelSource_getBrightness_t) 0xa3b84; - static uint32_t Level_players_property_offset = 0x60; // std::vector -// Region +// LevelSource -static LevelSource_getBrightness_t Region_getBrightness = (LevelSource_getBrightness_t) 0xadaa8; +typedef unsigned char *(*LevelSource_getBiome_t)(unsigned char *level_source, int32_t x, int32_t z); +static uint32_t LevelSource_getBiome_vtable_offset = 0x24; // Material