LeviLamina
Loading...
Searching...
No Matches
BlockEventListener.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/world/events/EventResult.h"
7#include "mc/world/level/block/actor/PistonState.h"
8
9// auto generated forward declare list
10// clang-format off
11class Actor;
12class Block;
13class BlockPos;
14class Dimension;
15class ItemStackBase;
16class Level;
17class Player;
19struct NewBlockID;
20// clang-format on
21
23public:
24 // BlockEventListener inner types define
25 using EventType = ::BlockNotificationEvent;
26
27public:
28 // virtual functions
29 // NOLINTBEGIN
30 virtual ~BlockEventListener() = default;
31
32 virtual ::EventResult
33 onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
34
35 virtual ::EventResult onBlockDestroyedByPlayer(
36 ::Player& player,
37 ::Block const& destroyedBlock,
38 ::BlockPos const& pos,
39 ::ItemStackBase const& currentItem,
40 ::ItemStackBase const& itemBeforeBlockBreak
41 );
42
43 virtual ::EventResult onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
44
45 virtual ::EventResult
46 onBlockMovedByPiston(::BlockPos const& pistonPos, ::BlockPos const& blockPos, ::PistonState const action);
47
48 virtual ::EventResult onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
49
50 virtual ::EventResult onBlockDestructionStarted(
51 ::Player& player,
52 ::BlockPos const& pos,
53 ::Block const& hitBlock,
54 uchar const face,
55 int const previousProgress
56 );
57
58 virtual ::EventResult onBlockDestructionContinued(
59 ::Player& player,
60 ::BlockPos const& pos,
61 ::Block const& block,
62 uchar const face,
63 int const previousProgress
64 );
65
66 virtual ::EventResult onBlockInteractedWith(::Player& player, ::BlockPos const& blockPos);
67
68 virtual ::EventResult
69 onBlockExploded(::Dimension& dimension, ::BlockPos const& blockPos, ::Block const& destroyedBlock, ::Actor* source);
70
71 virtual ::EventResult onBlockModified(::BlockPos const& pos, ::Block const& oldBlock, ::Block const& newBlock);
72
73 virtual ::EventResult onUnknownBlockReceived(::Level& level, ::NewBlockID const& blockId, ushort data);
74
75 virtual ::EventResult onEvent(::BlockNotificationEvent const& event);
76 // NOLINTEND
77
78public:
79 // virtual function thunks
80 // NOLINTBEGIN
81 MCFOLD ::EventResult $onBlockDestroyedByPlayer(
82 ::Player& player,
83 ::Block const& destroyedBlock,
84 ::BlockPos const& pos,
85 ::ItemStackBase const& currentItem,
86 ::ItemStackBase const& itemBeforeBlockBreak
87 );
88
89 MCFOLD ::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
90
91 MCFOLD ::EventResult
92 $onBlockMovedByPiston(::BlockPos const& pistonPos, ::BlockPos const& blockPos, ::PistonState const action);
93
94 MCFOLD ::EventResult $onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
95
96 MCFOLD ::EventResult $onBlockDestructionStarted(
97 ::Player& player,
98 ::BlockPos const& pos,
99 ::Block const& hitBlock,
100 uchar const face,
101 int const previousProgress
102 );
103
104 MCFOLD ::EventResult $onBlockDestructionContinued(
105 ::Player& player,
106 ::BlockPos const& pos,
107 ::Block const& block,
108 uchar const face,
109 int const previousProgress
110 );
111
112 MCFOLD ::EventResult $onBlockInteractedWith(::Player& player, ::BlockPos const& blockPos);
113
114 MCFOLD ::EventResult $onBlockExploded(
115 ::Dimension& dimension,
116 ::BlockPos const& blockPos,
117 ::Block const& destroyedBlock,
118 ::Actor* source
119 );
120
121 MCFOLD ::EventResult $onBlockModified(::BlockPos const& pos, ::Block const& oldBlock, ::Block const& newBlock);
122
123 MCFOLD ::EventResult $onUnknownBlockReceived(::Level& level, ::NewBlockID const& blockId, ushort data);
124
125#ifdef LL_PLAT_C
126 MCFOLD ::EventResult
127 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
128
129 MCFOLD ::EventResult $onEvent(::BlockNotificationEvent const& event);
130#endif
131
132
133 // NOLINTEND
134};
Definition Actor.h:113
Definition BlockEventListener.h:22
Definition BlockPos.h:17
Definition Block.h:41
Definition Dimension.h:86
Definition ItemStackBase.h:44
Definition Level.h:254
Definition Player.h:129
Definition BlockNotificationEvent.h:63
Definition NewBlockID.h:8