Skip to content

Commit 91beca9

Browse files
author
誠 遺憾
committed
1.21.6X
1 parent bd9c3de commit 91beca9

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

ForceEnchant/Force/Hooks/CommandHook/CommandHook.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace CommandHook {
1010
ValidRange() : Hook("Command::ValidRange") {};
1111
static bool handle(int input, int low, int high, __int64 out);
1212
bool Initialize() override {
13-
uintptr_t address = SigScan("40 55 53 56 57 41 56 48 8D 6C 24 C9 48 81 EC ?? ?? ?? ?? 49 8B D9 41");
13+
uintptr_t address = SigScan("40 55 53 56 57 41 56 48 8D 6C 24 C9 48 81 EC ?? ?? ?? ?? 49 8B D9");
1414
return CreateHook(funcPtr, address, handle);
1515
}
1616
};
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "ItemEnchants.h"
22

3-
EnchantResult* ItemEnchantsHook::canEnchant::handle(__int64 _this, EnchantResult* result, __int64 en, bool allowNonVanilla) {
4-
static auto oFunc = funcPtr->GetFastcall<EnchantResult*, __int64, EnchantResult*, __int64, bool>();
3+
EnchantResult* ItemEnchantsHook::canEnchant::handle(__int64 _this, EnchantResult* result, EnchantMentInstance* en, bool allowNonVanilla) {
4+
static auto oFunc = funcPtr->GetFastcall<EnchantResult*, __int64, EnchantResult*, EnchantMentInstance*, bool>();
55
return oFunc(_this, result, en, true);
66
}

ForceEnchant/Force/Hooks/ItemEnchants/ItemEnchants.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace ItemEnchantsHook {
99
static inline std::unique_ptr<FuncHook> funcPtr;
1010
public:
1111
canEnchant() : Hook("ItemEnchants::canEnchant") {};
12-
static EnchantResult* handle(__int64 _this, EnchantResult* result, __int64 en, bool allowNonVanilla);
12+
static EnchantResult* handle(__int64 _this, EnchantResult* result, EnchantMentInstance* en, bool allowNonVanilla);
1313
bool Initialize() override {
1414
uintptr_t address = SigScan("4C 89 44 24 ?? 53 55 57 41");
1515
return CreateHook(funcPtr, address, handle);

ForceEnchant/Force/SDK/EnchantResult.h

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
class EnchantMentInstance {
55
public:
66
BUILD_ACCESS(int, enchantType, 0x0);
7+
BUILD_ACCESS(int, level, 0x4);
78
};
89

910
class EnchantResult {

0 commit comments

Comments
 (0)