diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5124c3676a..fc9f2293a5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -51,6 +51,7 @@ * `Render Vignette` (Enabled By Default) * `Increase Render Chunk Size` (Enabled By Default) * `Proper Entity Shading` (Enabled By Default) + * `Fix Sugar Position In Hand` (Enabled By Default) * Existing Functionality (All Enabled By Default) * `Fix Screen Rendering When Hiding HUD` * `Sanitize Usernames` diff --git a/launcher/src/client/available-feature-flags b/launcher/src/client/available-feature-flags index 9f2b5bb90d..75212c0ee8 100644 --- a/launcher/src/client/available-feature-flags +++ b/launcher/src/client/available-feature-flags @@ -111,4 +111,5 @@ TRUE 3D Dropped Items TRUE Render Entity Shadows TRUE Render Vignette TRUE Increase Render Chunk Size -TRUE Proper Entity Shading \ No newline at end of file +TRUE Proper Entity Shading +TRUE Fix Sugar Position In Hand \ No newline at end of file diff --git a/mods/src/misc/misc.cpp b/mods/src/misc/misc.cpp index c5a16795e6..34f39c7353 100644 --- a/mods/src/misc/misc.cpp +++ b/mods/src/misc/misc.cpp @@ -442,6 +442,11 @@ static int Dimension_isValidSpawn_Level_getTopTile_injection(Level *self, int x, return ret; } +// Prevent Sugar From Being "handEquipped()" +static Item *Item_initItems_Item_handEquipped_injection(Item *self) { + return self; +} + // Init void init_misc() { // Sanitize Username @@ -592,6 +597,11 @@ void init_misc() { overwrite_call((void *) 0xb198c, (void *) Dimension_isValidSpawn_Level_getTopTile_injection); } + // Fix Sugar Rendering + if (feature_has("Fix Sugar Position In Hand", server_disabled)) { + overwrite_call((void *) 0x976f8, (void *) Item_initItems_Item_handEquipped_injection); + } + // Disable overwrite_calls() After Minecraft::init misc_run_on_init([](__attribute__((unused)) Minecraft *minecraft) { thunk_enabler = [](__attribute__((unused)) void *a, __attribute__((unused)) void *b) -> void * { diff --git a/symbols/src/item/Item.def b/symbols/src/item/Item.def index ce3501287b..8e784ea398 100644 --- a/symbols/src/item/Item.def +++ b/symbols/src/item/Item.def @@ -26,6 +26,7 @@ virtual-method std::string getDescriptionId(const ItemInstance *item_instance) = virtual-method ItemInstance *getCraftingRemainingItem(ItemInstance *item_instance) = 0x84; // Swing = 0, eating = 1, drinking = 2, bow = 4, anything else is nothing virtual-method int getUseAnimation() = 0x94; +virtual-method Item *handEquipped() = 0x58; property int id = 0x4; property int max_damage = 0x8;