diff --git a/VERSION b/VERSION index 0d3ad67..0b6e431 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.10 +2.2.11 diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 92ec92b..3a75124 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +**2.2.11** +* Add "Close Current Screen On Death" Feature Flag (Enabled By Default) To Prevent Bugs +* Fix More Furnace UI Bugs When Using "Disable 'gui_blocks' Atlas" + **2.2.10** * Fix Bug With Picking Up Items In "Remove Creative Mode Restrictions" Mode diff --git a/images/start.png b/images/start.png index f101b58..881bd45 100644 Binary files a/images/start.png and b/images/start.png differ diff --git a/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags b/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags index 0436ec6..5a41c92 100644 --- a/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags +++ b/launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags @@ -28,3 +28,4 @@ TRUE Render Selected Item Text TRUE External Server Support TRUE Load Language Files TRUE Implement Sound Engine +TRUE Close Current Screen On Death diff --git a/mods/src/misc/misc.c b/mods/src/misc/misc.c index 6660737..16c8ced 100644 --- a/mods/src/misc/misc.c +++ b/mods/src/misc/misc.c @@ -135,10 +135,20 @@ static unsigned char *RakNetInstance_injection(unsigned char *rak_net_instance) return result; } +// Close Current Screen On Death To Prevent Bugs +static void LocalPlayer_die_injection(unsigned char *entity, unsigned char *cause) { + // Close Screen + unsigned char *minecraft = *(unsigned char **) (entity + LocalPlayer_minecraft_property_offset); + (*Minecraft_setScreen)(minecraft, NULL); + + // Call Original Method + (*LocalPlayer_die)(entity, cause); +} + // Init void init_misc() { + // Remove Invalid Item Background (A Red Background That Appears For Items That Are Not Included In The gui_blocks Atlas) if (feature_has("Remove Invalid Item Background", 0)) { - // Remove Invalid Item Background (A Red Background That Appears For Items That Are Not Included In The gui_blocks Atlas) unsigned char invalid_item_background_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop" patch((void *) 0x63c98, invalid_item_background_patch); } @@ -162,6 +172,11 @@ void init_misc() { // Fix Bug Where RakNetInstance Starts Pinging Potential Servers Before The "Join Game" Screen Is Opened overwrite_calls((void *) RakNetInstance, (void *) RakNetInstance_injection); + // Close Current Screen On Death To Prevent Bugs + if (feature_has("Close Current Screen On Death", 0)) { + patch_address(LocalPlayer_die_vtable_addr, (void *) LocalPlayer_die_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 1661caf..ca4674a 100644 --- a/symbols/include/symbols/minecraft.h +++ b/symbols/include/symbols/minecraft.h @@ -268,9 +268,6 @@ static ItemInstance_constructor_extra_t ItemInstance_constructor_item_extra = (I // Entity -typedef void (*Entity_die_t)(unsigned char *entity, unsigned char *cause); -static uint32_t Entity_die_vtable_offset = 0x130; - static uint32_t Entity_x_property_offset = 0x4; // float static uint32_t Entity_y_property_offset = 0x8; // float static uint32_t Entity_z_property_offset = 0xc; // float @@ -288,6 +285,9 @@ static uint32_t Mob_actuallyHurt_vtable_offset = 0x16c; typedef float (*Mob_getWalkingSpeedModifier_t)(unsigned char *entity); +typedef void (*Mob_die_t)(unsigned char *entity, unsigned char *cause); +static uint32_t Mob_die_vtable_offset = 0x130; + static uint32_t Mob_health_property_offset = 0xec; // int32_t // Player @@ -310,6 +310,9 @@ static void *LocalPlayer_actuallyHurt_vtable_addr = (void *) 0x10639c; static void *LocalPlayer_openTextEdit_vtable_addr = (void *) 0x106460; +static Mob_die_t LocalPlayer_die = (Mob_die_t) 0x45078; +static void *LocalPlayer_die_vtable_addr = (void *) 0x106360; + static uint32_t LocalPlayer_minecraft_property_offset = 0xc90; // Minecraft * // ServerPlayer