Fix Sign Without Fix Bow & Arrow

This commit is contained in:
TheBrokenRail 2020-11-10 10:08:42 -05:00
parent cd911f5635
commit c21197324b
2 changed files with 13 additions and 8 deletions

View File

@ -24,13 +24,16 @@ static Minecraft_tickInput_t Minecraft_tickInput = (Minecraft_tickInput_t) 0x15f
typedef int (*Player_isUsingItem_t)(unsigned char *player);
static Player_isUsingItem_t Player_isUsingItem = (Player_isUsingItem_t) 0x8f15c;
// Enable Bow & Arrow Fix
static int fix_bow = 0;
static void Minecraft_tickInput_injection(unsigned char *minecraft) {
// Call Original Method
(*Minecraft_tickInput)(minecraft);
if (fix_bow && !is_right_click) {
// GameMode Is Offset From minecraft By 0x160
// Player Is Offset From minecraft By 0x18c
if (!is_right_click) {
unsigned char *game_mode = *(unsigned char **) (minecraft + 0x160);
unsigned char *player = *(unsigned char **) (minecraft + 0x18c);
if (player != NULL && game_mode != NULL && (*Player_isUsingItem)(player)) {
@ -40,6 +43,7 @@ static void Minecraft_tickInput_injection(unsigned char *minecraft) {
}
}
// Clear Unused Sign Input
extra_clear_input();
}
@ -207,10 +211,10 @@ __attribute__((constructor)) static void init() {
// Disable Opening Inventory Using The Cursor When Cursor Is Hidden
overwrite_calls((void *) Gui_handleClick, Gui_handleClick_injection);
if (extra_has_feature("Fix Bow & Arrow")) {
// Fix Bow
// Enable Bow & Arrow Fix
fix_bow = extra_has_feature("Fix Bow & Arrow");
// Fix Bow & Arrow + Clear Unused Sign Input
overwrite_calls((void *) Minecraft_tickInput, Minecraft_tickInput_injection);
}
if (extra_has_feature("Fix Attacking")) {
// Allow Attacking Mobs

View File

@ -149,7 +149,8 @@ extern "C" {
patch_address((void *) 0x10531c, (void *) Screen_updateEvents_injection);
}
if (extra_has_feature("Expand Creative Inventory")) {
int is_server = extra_get_mode() == 2;
if (!is_server && extra_has_feature("Expand Creative Inventory")) {
// Add Extra Items To Creative Inventory
overwrite_calls((void *) FillingContainer_addItem, (void *) FillingContainer_addItem_injection);
}