-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestMod.cpp
More file actions
37 lines (31 loc) · 912 Bytes
/
TestMod.cpp
File metadata and controls
37 lines (31 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "pch.h"
#include "TestMod.h"
#include "Util/HookHelper.h"
#include "Hooks/Minecraft.World/item/Item.h"
#include "InternalHooks/Minecraft.h"
#include "Hooks/Minecraft.World/item/SwordItem.h"
// This stores all the hooks
std::vector<std::tuple<PVOID*, PVOID>> hooks;
void TestMod::Enable()
{
Minecraft::onMain->addEventListener([]()
{
LOG("Main called");
// Things that require the game to be started such as UWP dependant methods can be called here.
});
// Register hooks down here (May change in the future)
registerHook(&(PVOID&)SwordItem_SwordItem_C1, &SwordItem::SwordItem_C1); // Swords do a lot of damage
registerHook(&(PVOID&)Item_registerItem, &Item::registerItem); // Item::registerItem logging
}
void TestMod::Disable()
{
unregisterHooks(hooks);
}
std::wstring TestMod::GetVersion()
{
return L"1.0.0";
}
std::wstring TestMod::GetName()
{
return L"Lantern Example Mod";
}