88#include " MinHook.h"
99
1010#include " minecraft/src/common/world/item/Item.h"
11+ #include " minecraft/src-client/common/client/renderer/screen/MinecraftUIRenderContext.h"
1112
1213HookManager hookManager;
1314
1415Item::_appendFormattedHovertext _Item_appendFormattedHovertext;
1516
1617static void Item_appendFormattedHovertext (Item* self, const ItemStackBase& itemStack, Level& level, std::string& text, uint8_t a5) {
1718 _Item_appendFormattedHovertext (self, itemStack, level, text, a5);
18- uint64_t max = itemStack.mItem ->getMaxDamage ();
19+ Item* item = itemStack.mItem ;
20+
21+ uint64_t max = item->getMaxDamage ();
1922
2023 if (max != 0 ) {
21- uint64_t current = max - itemStack. mItem ->getDamageValue (itemStack.mUserData );
24+ uint64_t current = max - item ->getDamageValue (itemStack.mUserData );
2225 text.append (fmt::format (" \n Durability: {} / {}" , current, max));
2326 }
2427
25- auto itemNamespace = reinterpret_cast <std::string*>(reinterpret_cast <uint64_t >(self) + 248 );
26-
2728 std::string rawNameId;
2829 itemStack.getRawNameId (rawNameId);
29- text.append (fmt::format (" \n {}8{}:{}" , " \xc2\xa7 " , *itemNamespace, rawNameId));
30-
30+ text.append (fmt::format (" \n {}8{}:{} ({}){}r" , " \xc2\xa7 " , item->mNamespace , rawNameId, item->mId , " \xc2\xa7 " ));
3131}
3232
3333BOOL APIENTRY DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
@@ -41,8 +41,6 @@ extern "C" __declspec(dllexport) void Initialize() {
4141 SigScan (" 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" ),
4242 &Item_appendFormattedHovertext, reinterpret_cast <void **>(&_Item_appendFormattedHovertext)
4343 );
44-
45- Log::Info (" Sizeof: {}\n " , sizeof (std::string));
4644}
4745
4846extern " C" __declspec(dllexport) void Shutdown () {
0 commit comments