11#include " dllmain.h"
22
3- HookManager hookManager;
43ClientInstance* client;
54
65ShulkerBoxBlockItem::_appendFormattedHovertext _Shulker_appendFormattedHoverText;
@@ -89,10 +88,25 @@ static void _renderHoverBox(HoverRenderer* self, MinecraftUIRenderContext* ctx,
8988 __renderHoverBox (self, ctx, client, aabb, someFloat);
9089}
9190
92- ModFunction void Initialize (const char * gameVersion, InputManager * inputManager) {
91+ void OnStartJoinGame (ClientInstance* ci) {
92+
93+ }
94+
95+ void OnRenderUI (ScreenView* screen, UIRenderContext* ctx) {
96+
97+ }
98+
99+ ModFunction void Initialize (HookManager* hookManager, Amethyst::EventManager* eventManager, InputManager * inputManager) {
93100 MH_Initialize ();
94101
95- hookManager.CreateHook (
102+ 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" );
103+
104+ hookManager->CreateHook (
105+ &Item::appendFormattedHovertext,
106+ &Item_appendFormattedHovertext, reinterpret_cast <void **>(&_Item_appendFormattedHovertext)
107+ );
108+
109+ /* hookManager.CreateHook(
96110 SigScan("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"),
97111 &Shulker_appendFormattedHovertext, reinterpret_cast<void**>(&_Shulker_appendFormattedHoverText)
98112 );
@@ -105,9 +119,8 @@ ModFunction void Initialize(const char* gameVersion, InputManager * inputManager
105119 hookManager.CreateHook(
106120 SigScan("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"),
107121 &_renderHoverBox, reinterpret_cast<void**>(&__renderHoverBox)
108- );
109- }
122+ );*/
110123
111- ModFunction void Shutdown () {
112- hookManager. Shutdown ( );
124+ eventManager-> onStartJoinGame . AddListener (OnStartJoinGame);
125+ eventManager-> onRenderUI . AddListener (OnRenderUI );
113126}
0 commit comments