LeviLamina
Loading...
Searching...
No Matches
BlockEventCoordinator.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/gameplayhandlers/CoordinatorResult.h"
7#include "mc/world/events/BlockGameplayEvent.h"
8#include "mc/world/events/EventCoordinator.h"
9#include "mc/world/events/EventRef.h"
10#include "mc/world/events/MutableBlockGameplayEvent.h"
11#include "mc/world/level/block/actor/PistonState.h"
12
13// auto generated forward declare list
14// clang-format off
15class Actor;
16class Block;
19class BlockPos;
20class Dimension;
21class ItemStackBase;
22class Level;
23class Player;
24struct NewBlockID;
25// clang-format on
26
27class BlockEventCoordinator : public ::EventCoordinator<::BlockEventListener> {
28public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BlockGameplayHandler>> mBlockGameplayHandler;
32 // NOLINTEND
33
34public:
35 // member functions
36 // NOLINTBEGIN
37 MCFOLD ::BlockGameplayHandler& getBlockGameplayHandler();
38
39 MCFOLD void registerBlockGameplayHandler(::std::unique_ptr<::BlockGameplayHandler>&& handler);
40
41 MCAPI void sendBlockDestroyedByPlayer(
42 ::Player& player,
43 ::Block const& destroyedBlock,
44 ::BlockPos const& pos,
45 ::ItemStackBase const& currentItem,
46 ::ItemStackBase const& itemBeforeBlockBreak
47 );
48
49 MCAPI void
50 sendBlockDestructionStarted(::Player& player, ::BlockPos const& blockPos, ::Block const& hitBlock, uchar face);
51
52 MCAPI void sendBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
53
54 MCAPI void sendBlockExploded(
55 ::Dimension& dimension,
56 ::BlockPos const& blockPos,
57 ::Block const& destroyedBlock,
58 ::Actor* source
59 );
60
61 MCAPI void sendBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
62
63 MCAPI void sendBlockInteractedWith(::Player& player, ::BlockPos const& blockPos);
64
65 MCAPI void sendBlockMovedByPiston(::BlockPos const& pistonPos, ::BlockPos const& blockPos, ::PistonState action);
66
67 MCAPI void
68 sendBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
69
70#ifdef LL_PLAT_C
71 MCAPI ::std::optional<::std::string>
72 sendEvent(::EventRef<::BlockGameplayEvent<::std::optional<::std::string>>> const& event);
73#endif
74
75 MCAPI ::CoordinatorResult sendEvent(::EventRef<::BlockGameplayEvent<::CoordinatorResult>> const& event);
76
77 MCAPI ::CoordinatorResult sendEvent(::EventRef<::MutableBlockGameplayEvent<::CoordinatorResult>> event);
78
79 MCAPI void sendEvent(::EventRef<::BlockGameplayEvent<void>> const& event);
80
81 MCAPI void sendUnknownBlockReceived(::Level& level, ::NewBlockID const& blockId, ushort data);
82 // NOLINTEND
83
84public:
85 // vftables
86 // NOLINTBEGIN
87 MCNAPI static void** $vftable();
88 // NOLINTEND
89};
Definition Actor.h:125
Definition BlockEventCoordinator.h:27
static MCAPI void ** $vftable()
Definition BlockEventListener.h:22
Definition BlockGameplayHandler.h:13
Definition BlockPos.h:21
Definition Block.h:69
Definition Dimension.h:89
Definition EventCoordinator.h:6
Definition EventRef.h:6
Definition ItemStackBase.h:52
Definition Level.h:255
Definition Player.h:137
Definition BlockGameplayEvent.h:22
Definition MutableBlockGameplayEvent.h:9
Definition NewBlockID.h:8