|
4 | 4 | #include "legacy/api/EventAPI.h"
|
5 | 5 | #include "legacy/api/ItemAPI.h"
|
6 | 6 | #include "legacy/api/PlayerAPI.h"
|
| 7 | +#include "ll/api/memory/Hook.h" |
| 8 | +#include "ll/api/memory/Memory.h" |
7 | 9 | #include "ll/api/service/Bedrock.h"
|
8 | 10 | #include "mc/common/ActorUniqueID.h"
|
9 |
| -#include "mc/deps/core/string/HashedString.h" |
| 11 | +#include "mc/deps/ecs/WeakEntityRef.h" |
10 | 12 | #include "mc/server/ServerPlayer.h"
|
| 13 | +#include "mc/server/module/VanillaServerGameplayEventListener.h" |
11 | 14 | #include "mc/world/ContainerID.h"
|
12 | 15 | #include "mc/world/actor/ActorDamageSource.h"
|
13 |
| -#include "mc/world/inventory/transaction/InventoryAction.h" |
14 |
| -#include "mc/world/inventory/transaction/InventorySource.h" |
15 |
| -#include "mc/world/inventory/transaction/InventoryTransaction.h" |
16 |
| -#include "mc/world/phys/HitResult.h" |
17 |
| -#include "ll/api/memory/Hook.h" |
18 |
| -#include "ll/api/memory/Memory.h" |
19 |
| -#include "mc/deps/ecs/WeakEntityRef.h" |
20 |
| -#include "mc/server/module/VanillaServerGameplayEventListener.h" |
21 | 16 | #include "mc/world/actor/ActorType.h"
|
22 | 17 | #include "mc/world/actor/FishingHook.h"
|
23 | 18 | #include "mc/world/actor/item/ItemActor.h"
|
24 | 19 | #include "mc/world/actor/player/Player.h"
|
| 20 | +#include "mc/world/actor/player/PlayerItemInUse.h" |
25 | 21 | #include "mc/world/containers/models/LevelContainerModel.h"
|
26 | 22 | #include "mc/world/events/BlockEventCoordinator.h"
|
27 | 23 | #include "mc/world/events/EventResult.h"
|
| 24 | +#include "mc/world/events/PlayerOpenContainerEvent.h" |
28 | 25 | #include "mc/world/gamemode/InteractionResult.h"
|
29 | 26 | #include "mc/world/inventory/transaction/ComplexInventoryTransaction.h"
|
| 27 | +#include "mc/world/inventory/transaction/InventoryAction.h" |
| 28 | +#include "mc/world/inventory/transaction/InventorySource.h" |
| 29 | +#include "mc/world/inventory/transaction/InventoryTransaction.h" |
30 | 30 | #include "mc/world/item/BucketItem.h"
|
31 | 31 | #include "mc/world/item/ItemInstance.h"
|
32 | 32 | #include "mc/world/item/ItemStack.h"
|
33 | 33 | #include "mc/world/level/BedrockSpawner.h"
|
34 | 34 | #include "mc/world/level/BlockSource.h"
|
35 | 35 | #include "mc/world/level/ChangeDimensionRequest.h"
|
| 36 | +#include "mc/world/level/Explosion.h" |
36 | 37 | #include "mc/world/level/Level.h"
|
37 | 38 | #include "mc/world/level/block/BasePressurePlateBlock.h"
|
38 | 39 | #include "mc/world/level/block/Block.h"
|
|
41 | 42 | #include "mc/world/level/block/actor/BarrelBlockActor.h"
|
42 | 43 | #include "mc/world/level/block/actor/ChestBlockActor.h"
|
43 | 44 | #include "mc/world/level/block/actor/PistonBlockActor.h"
|
44 |
| -#include "mc/world/phys/AABB.h" |
45 |
| -#include "mc/world/scores/ServerScoreboard.h" |
46 |
| -#include "mc/world/level/Explosion.h" |
47 |
| -#include "mc/world/events/PlayerOpenContainerEvent.h" |
48 |
| -#include "mc/world/level/material/Material.h" |
49 | 45 | #include "mc/world/level/dimension/Dimension.h"
|
50 |
| -#include "mc/world/actor/player/PlayerItemInUse.h" |
| 46 | +#include "mc/world/level/material/Material.h" |
| 47 | +#include "mc/world/phys/AABB.h" |
| 48 | +#include "mc/world/phys/HitResult.h" |
51 | 49 |
|
52 | 50 | namespace lse::events::player {
|
53 | 51 | LL_TYPE_INSTANCE_HOOK(
|
@@ -346,13 +344,7 @@ LL_TYPE_INSTANCE_HOOK(
|
346 | 344 | origin(player, std::move(changeRequest));
|
347 | 345 | }
|
348 | 346 |
|
349 |
| -LL_TYPE_INSTANCE_HOOK( |
350 |
| - OpenContainerScreenHook, |
351 |
| - HookPriority::Normal, |
352 |
| - Player, |
353 |
| - &Player::canOpenContainerScreen, |
354 |
| - bool |
355 |
| -) { |
| 347 | +LL_TYPE_INSTANCE_HOOK(OpenContainerScreenHook, HookPriority::Normal, Player, &Player::canOpenContainerScreen, bool) { |
356 | 348 | IF_LISTENED(EVENT_TYPES::onOpenContainerScreen) {
|
357 | 349 | if (!CallEvent(EVENT_TYPES::onOpenContainerScreen, PlayerClass::newPlayer(this))) {
|
358 | 350 | return false;
|
@@ -406,13 +398,7 @@ LL_TYPE_INSTANCE_HOOK(
|
406 | 398 | IF_LISTENED_END(EVENT_TYPES::onBedEnter);
|
407 | 399 | return origin(pos);
|
408 | 400 | }
|
409 |
| -LL_TYPE_INSTANCE_HOOK( |
410 |
| - OpenInventoryHook, |
411 |
| - HookPriority::Normal, |
412 |
| - ServerPlayer, |
413 |
| - &ServerPlayer::$openInventory, |
414 |
| - void, |
415 |
| -) { |
| 401 | +LL_TYPE_INSTANCE_HOOK(OpenInventoryHook, HookPriority::Normal, ServerPlayer, &ServerPlayer::$openInventory, void, ) { |
416 | 402 | IF_LISTENED(EVENT_TYPES::onOpenInventory) {
|
417 | 403 | if (!CallEvent(EVENT_TYPES::onOpenInventory, PlayerClass::newPlayer(this))) {
|
418 | 404 | return;
|
|
0 commit comments