1313#include " minecraft/src-client/common/client/gui/ScreenView.h"
1414#include " minecraft/src-client/common/client/renderer/TexturePtr.h"
1515#include " minecraft/src-deps/core/string/StringHash.h"
16+ #include " minecraft/src/common/world/item/ItemStackBase.h"
1617
1718HookManager hookManager;
1819
@@ -25,8 +26,8 @@ static void Item_appendFormattedHovertext(Item* self, const ItemStackBase& itemS
2526 uint64_t max = item->getMaxDamage ();
2627
2728 if (max != 0 ) {
28- uint64_t current = max - item->getDamageValue (itemStack.mUserData );
29- text.append (fmt::format (" \n {}7Durability: {} / {}{}r" , " \xc2\xa7 " , current , max, " \xc2\xa7 " ));
29+ uint64_t remaining = max - item->getDamageValue (itemStack.mUserData );
30+ text.append (fmt::format (" \n {}7Durability: {} / {}{}r" , " \xc2\xa7 " , remaining , max, " \xc2\xa7 " ));
3031 }
3132
3233 std::string rawNameId;
@@ -53,32 +54,32 @@ extern "C" __declspec(dllexport) void OnStartJoinGame(ClientInstance* ci) {
5354 g_client = ci;
5455}
5556
56- extern " C" __declspec(dllexport) void OnRenderUI (ScreenView* screenView, MinecraftUIRenderContext* ctx) {
57- if (g_client == nullptr ) return ;
58-
59- LocalPlayer* player = g_client->getLocalPlayer ();
60- if (player == nullptr ) return ;
61-
62- std::string text = " Minecraft 1.20.30.02 (AmethystAPI)" ;
63-
64- Vec3* pos = player->getPosition ();
65- Vec3* rot = player->getHeadLookVector (1 .0f );
66- text.append (fmt::format (" \n\n XYZ: {:.3f} / {:.3f} / {:.3f}" , pos->x , pos->y , pos->z ));
67- text.append (fmt::format (" \n Rot: {} {} {}" , rot->x , rot->y , rot->z ));
68-
69- // Render text on screen
70- RectangleArea rect = { 0 .0f , 0 .0f , 0 .0f , 0 .0f };
71- mce::Color white (1 .0f , 1 .0f , 1 .0f , 1 .0f );
72-
73- TextMeasureData textData;
74- memset (&textData, 0 , sizeof (TextMeasureData));
75- textData.fontSize = 1 .0f ;
76-
77- CaretMeasureData caretData;
78- memset (&caretData, 1 , sizeof (CaretMeasureData));
79-
80- ctx->drawDebugText (&rect, &text, &white, 1 .0f , ui::Left, &textData, &caretData);
81- }
57+ // extern "C" __declspec(dllexport) void OnRenderUI(ScreenView* screenView, MinecraftUIRenderContext* ctx) {
58+ // if (g_client == nullptr) return;
59+ //
60+ // LocalPlayer* player = g_client->getLocalPlayer();
61+ // if (player == nullptr) return;
62+ //
63+ // std::string text = "Minecraft 1.20.51 (AmethystAPI)";
64+ //
65+ // // Vec3* pos = player->getPosition();
66+ // // Vec3* rot = player->getHeadLookVector(1.0f);
67+ // // text.append(fmt::format("\n\nXYZ: {:.3f} / {:.3f} / {:.3f}", pos->x, pos->y, pos->z));
68+ // // text.append(fmt::format("\nRot: {} {} {}", rot->x, rot->y, rot->z));
69+ //
70+ // // Render text on screen
71+ // RectangleArea rect = { 0.0f, 0.0f, 0.0f, 0.0f };
72+ // mce::Color white(1.0f, 1.0f, 1.0f, 1.0f);
73+ //
74+ // TextMeasureData textData;
75+ // memset(&textData, 0, sizeof(TextMeasureData));
76+ // textData.fontSize = 1.0f;
77+ //
78+ // CaretMeasureData caretData;
79+ // memset(&caretData, 1, sizeof(CaretMeasureData));
80+ //
81+ // ctx->drawDebugText(&rect, &text, &white, 1.0f, ui::Left, &textData, &caretData);
82+ // }
8283
8384extern " C" __declspec(dllexport) void Shutdown () {
8485 hookManager.Shutdown ();
0 commit comments