Stop Doors And Trapdoors Closing When Updated

This commit is contained in:
Bigjango13 2025-03-25 16:39:05 -07:00
parent de378826bf
commit 1417bf6269
4 changed files with 15 additions and 1 deletions

View File

@ -68,6 +68,7 @@
* `Fix Eggs Spawning Abnormally Healthy Chickens` (Enabled By Default) * `Fix Eggs Spawning Abnormally Healthy Chickens` (Enabled By Default)
* `Correctly Close API Sockets` (Enabled By Default) * `Correctly Close API Sockets` (Enabled By Default)
* `Optimized API Sockets` (Enabled By Default) * `Optimized API Sockets` (Enabled By Default)
* `Stop Doors And Trapdoors Closing When Updated` (Disabled By Default)
* Existing Functionality (All Enabled By Default) * Existing Functionality (All Enabled By Default)
* `Fix Screen Rendering When Hiding HUD` * `Fix Screen Rendering When Hiding HUD`
* `Sanitize Usernames` * `Sanitize Usernames`

View File

@ -159,4 +159,5 @@ CATEGORY Miscellaneous
TRUE Screenshot Support TRUE Screenshot Support
TRUE Add Camera Functionality TRUE Add Camera Functionality
TRUE Update Default Options TRUE Update Default Options
TRUE Remove Chest Placement Restrictions TRUE Remove Chest Placement Restrictions
FALSE Stop Doors And Trapdoors Closing When Updated

View File

@ -698,6 +698,14 @@ void init_misc() {
overwrite_call((void *) 0x7de0c, Chicken_moveTo, ThrownEgg_onHit_Chicken_moveTo_injection); overwrite_call((void *) 0x7de0c, Chicken_moveTo, ThrownEgg_onHit_Chicken_moveTo_injection);
} }
// Stop Doors And Trapdoors Closing When Updated
if (feature_has("Stop Doors And Trapdoors Closing When Updated", server_disabled)) {
// Patch out the `setOpen` call for doors and trap doors in neighborChanged
unsigned char nop_patch[4] = {0x00, 0xf0, 0x20, 0xe3}; // "nop"
patch((void *) 0xbe1a0, nop_patch); // door
patch((void *) 0xcf818, nop_patch); // trapdoor
}
// Disable overwrite_calls() After Minecraft::init // Disable overwrite_calls() After Minecraft::init
misc_run_on_init([](__attribute__((unused)) Minecraft *minecraft) { misc_run_on_init([](__attribute__((unused)) Minecraft *minecraft) {
thunk_enabler = [](__attribute__((unused)) void *a, __attribute__((unused)) void *b) -> void * { thunk_enabler = [](__attribute__((unused)) void *a, __attribute__((unused)) void *b) -> void * {

View File

@ -6,6 +6,10 @@ vtable-size 0x13c;
constructor (Level *level, Entity *thrower) = 0x8ccf0; constructor (Level *level, Entity *thrower) = 0x8ccf0;
virtual-method float getThrowPower() = 0x12c;
virtual-method float getThrowUpAngleOffset() = 0x130;
virtual-method float getGravity() = 0x134;
virtual-method void onHit(HitResult *res) = 0x138; virtual-method void onHit(HitResult *res) = 0x138;
property int thrower_id = 0xd8; property int thrower_id = 0xd8;
property int life = 0xdc;