Browse Source

Add "Close Current Screen On Death"

master 2.2.11
TheBrokenRail 2 weeks ago
parent
commit
4a69d38e35
  1. 2
      VERSION
  2. 4
      docs/CHANGELOG.md
  3. BIN
      images/start.png
  4. 1
      launcher/client-data/lib/minecraft-pi-reborn-client/available-feature-flags
  5. 17
      mods/src/misc/misc.c
  6. 9
      symbols/include/symbols/minecraft.h

2
VERSION

@ -1 +1 @@
2.2.10
2.2.11

4
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

BIN
images/start.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

1
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

17
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();

9
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

Loading…
Cancel
Save