@@ -20,8 +20,7 @@ static void Item_appendFormattedHovertext(Item* self, const ItemStackBase& itemS
2020 text.append (fmt::format (" \n {}7Durability: {} / {}{}r" , " \xc2\xa7 " , current, max, " \xc2\xa7 " ));
2121 }
2222
23- std::string rawNameId;
24- itemStack.getRawNameId (rawNameId);
23+ std::string rawNameId = itemStack.getRawNameId ();
2524
2625 if (rawNameId.find (" shulker_box" ) != std::string::npos) {
2726 // Don't append the id for shulker boxes (makes it too long)
@@ -35,7 +34,6 @@ static void Item_appendFormattedHovertext(Item* self, const ItemStackBase& itemS
3534int index = 0 ;
3635
3736static void Shulker_appendFormattedHovertext (ShulkerBoxBlockItem* self, const ItemStackBase& itemStack, Level& level, std::string& text, uint8_t someBool) {
38- Log::Info (" Shulker appendFormattedHovertext" );
3937 // Use the appendFormattedHovertext for regular items, we don't want the list of items
4038 Item_appendFormattedHovertext (self, itemStack, level, text, someBool);
4139
@@ -89,13 +87,13 @@ static void HoverRenderer__renderHoverBox(HoverRenderer* self, MinecraftUIRender
8987 _HoverRenderer__renderHoverBox.thiscall (self, ctx, client, aabb, someFloat);
9088}
9189
92- ModFunction void Initialize (HookManager* hookManager, Amethyst::EventManager* eventManager, InputManager * inputManager ) {
93- hookManager-> RegisterFunction (&Item::appendFormattedHovertext, " 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 44 24 ? 4C 8B F2 48 8B D9" );
94- hookManager-> CreateHook (&Item::appendFormattedHovertext, _Item_appendFormattedHoverText, &Item_appendFormattedHovertext);
90+ ModFunction void Initialize (AmethystContext* ctx ) {
91+ ctx-> mHookManager . RegisterFunction (&Item::appendFormattedHovertext, " 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 49 8B F1 4C 89 44 24 ? 4C 8B F2 48 8B D9" );
92+ ctx-> mHookManager . CreateHook (&Item::appendFormattedHovertext, _Item_appendFormattedHoverText, &Item_appendFormattedHovertext);
9593
96- hookManager-> RegisterFunction (&ShulkerBoxBlockItem::appendFormattedHovertext, " 40 53 55 56 57 41 56 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 4D 8B F9 48 8B DA" );
97- hookManager-> CreateHook (&ShulkerBoxBlockItem::appendFormattedHovertext, _Shulker_appendFormattedHoverText, &Shulker_appendFormattedHovertext);
94+ ctx-> mHookManager . RegisterFunction (&ShulkerBoxBlockItem::appendFormattedHovertext, " 40 53 55 56 57 41 56 41 57 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 44 24 ? 4D 8B F9 48 8B DA" );
95+ ctx-> mHookManager . CreateHook (&ShulkerBoxBlockItem::appendFormattedHovertext, _Shulker_appendFormattedHoverText, &Shulker_appendFormattedHovertext);
9896
99- hookManager-> RegisterFunction (&HoverRenderer::_renderHoverBox, " 48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 4C 89 70 ? 55 48 8D 68 ? 48 81 EC ? ? ? ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 49 8B D9" );
100- hookManager-> CreateHook (&HoverRenderer::_renderHoverBox, _HoverRenderer__renderHoverBox, &HoverRenderer__renderHoverBox);
97+ ctx-> mHookManager . RegisterFunction (&HoverRenderer::_renderHoverBox, " 48 8B C4 48 89 58 ? 48 89 70 ? 48 89 78 ? 4C 89 70 ? 55 48 8D 68 ? 48 81 EC ? ? ? ? 0F 29 70 ? 0F 29 78 ? 44 0F 29 40 ? 49 8B D9" );
98+ ctx-> mHookManager . CreateHook (&HoverRenderer::_renderHoverBox, _HoverRenderer__renderHoverBox, &HoverRenderer__renderHoverBox);
10199}
0 commit comments