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#ifdef LL_PLAT_S
33 virtual ::EventResult onBlockPlacedByPlayer(::Player&, ::Block const&, ::BlockPos const&, bool);
34#else // LL_PLAT_C
35 virtual ::EventResult
36 onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
37#endif
38
39 virtual ::EventResult onBlockDestroyedByPlayer(
40 ::Player& player,
41 ::Block const& destroyedBlock,
42 ::BlockPos const& pos,
43 ::ItemStackBase const& currentItem,
44 ::ItemStackBase const& itemBeforeBlockBreak
45 );
46
47 virtual ::EventResult onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
48
49 virtual ::EventResult
50 onBlockMovedByPiston(::BlockPos const& pistonPos, ::BlockPos const& blockPos, ::PistonState const action);
51
52 virtual ::EventResult onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
53
54 virtual ::EventResult
55 onBlockDestructionStarted(::Player& player, ::BlockPos const& pos, ::Block const& hitBlock, uchar const face);
56
57 virtual ::EventResult onBlockInteractedWith(::Player& player, ::BlockPos const& blockPos);
58
59 virtual ::EventResult
60 onBlockExploded(::Dimension& dimension, ::BlockPos const& blockPos, ::Block const& destroyedBlock, ::Actor* source);
61
62 virtual ::EventResult onBlockModified(::BlockPos const& pos, ::Block const& oldBlock, ::Block const& newBlock);
63
64 virtual ::EventResult onUnknownBlockReceived(::Level& level, ::NewBlockID const& blockId, ushort data);
65
66 virtual ::EventResult onEvent(::BlockNotificationEvent const& event);
67 // NOLINTEND
68
69public:
70 // virtual function thunks
71 // NOLINTBEGIN
72 MCFOLD ::EventResult $onBlockDestroyedByPlayer(
73 ::Player& player,
74 ::Block const& destroyedBlock,
75 ::BlockPos const& pos,
76 ::ItemStackBase const& currentItem,
77 ::ItemStackBase const& itemBeforeBlockBreak
78 );
79
80 MCFOLD ::EventResult $onBlockInPosWillBeDestroyedByPlayer(::Player& player, ::BlockPos const& pos);
81
82 MCFOLD ::EventResult
83 $onBlockMovedByPiston(::BlockPos const& pistonPos, ::BlockPos const& blockPos, ::PistonState const action);
84
85 MCFOLD ::EventResult $onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
86
87 MCFOLD ::EventResult
88 $onBlockDestructionStarted(::Player& player, ::BlockPos const& pos, ::Block const& hitBlock, uchar const face);
89
90 MCFOLD ::EventResult $onBlockInteractedWith(::Player& player, ::BlockPos const& blockPos);
91
92 MCFOLD ::EventResult $onBlockExploded(
93 ::Dimension& dimension,
94 ::BlockPos const& blockPos,
95 ::Block const& destroyedBlock,
96 ::Actor* source
97 );
98
99 MCFOLD ::EventResult $onBlockModified(::BlockPos const& pos, ::Block const& oldBlock, ::Block const& newBlock);
100
101 MCFOLD ::EventResult $onUnknownBlockReceived(::Level& level, ::NewBlockID const& blockId, ushort data);
102
103#ifdef LL_PLAT_C
104 MCFOLD ::EventResult
105 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
106
107 MCFOLD ::EventResult $onEvent(::BlockNotificationEvent const& event);
108#endif
109
110
111 // NOLINTEND
112};
Definition Actor.h:125
Definition BlockEventListener.h:22
Definition BlockPos.h:21
Definition Block.h:69
Definition Dimension.h:89
Definition ItemStackBase.h:52
Definition Level.h:255
Definition Player.h:137
Definition BlockNotificationEvent.h:63
Definition NewBlockID.h:8