LeviLamina
Loading...
Searching...
No Matches
ScriptBlockGlobalEventListener.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/scripting/modules/minecraft/Listener.h"
5
6// auto generated inclusion list
7#include "mc/world/events/BlockEventListener.h"
8#include "mc/world/events/EventListenerDispatcher.h"
9#include "mc/world/events/EventResult.h"
10
11// auto generated forward declare list
12// clang-format off
13class Actor;
14class Block;
15class BlockPos;
16class Dimension;
17class ItemStackBase;
18class Player;
19struct ButtonPushEvent;
21struct LeverActionEvent;
27namespace ScriptModuleMinecraft { class ScriptBlockBreakingEventListener; }
28namespace ScriptModuleMinecraft::ScriptGlobalEventListenerUtils { struct Listener; }
29// clang-format on
30
31namespace ScriptModuleMinecraft {
32
33class ScriptBlockGlobalEventListener : public ::EventListenerDispatcher<::BlockEventListener> {
34public:
35 // member variables
36 // NOLINTBEGIN
37 ::ll::TypedStorage<8, 24, ::std::vector<::ScriptModuleMinecraft::ScriptGlobalEventListenerUtils::Listener>>
38 mListeners;
39 ::ll::TypedStorage<
40 8,
41 8,
42 ::gsl::not_null<::std::unique_ptr<::ScriptModuleMinecraft::ScriptBlockBreakingEventListener>>>
43 mBlockBreakingListener;
44 // NOLINTEND
45
46public:
47 // virtual functions
48 // NOLINTBEGIN
49 virtual ~ScriptBlockGlobalEventListener() /*override*/ = default;
50
51 virtual ::EventResult onEvent(::PistonActionEvent const& eventData) /*override*/;
52
53 virtual ::EventResult onEvent(::LeverActionEvent const& eventData) /*override*/;
54
55 virtual ::EventResult onEvent(::ButtonPushEvent const& eventData) /*override*/;
56
57 virtual ::EventResult onEvent(::PressurePlatePushEvent const& eventData) /*override*/;
58
59 virtual ::EventResult onEvent(::PressurePlatePopEvent const& eventData) /*override*/;
60
61 virtual ::EventResult onEvent(::TripWireTripEvent const& eventData) /*override*/;
62
63 virtual ::EventResult onEvent(::TargetBlockHitEvent const& eventData) /*override*/;
64
65 virtual ::EventResult onEvent(::ExplosionStartedEvent const& eventData) /*override*/;
66
67 virtual ::EventResult onBlockExploded(
68 ::Dimension& dimension,
69 ::BlockPos const& blockPos,
70 ::Block const& destroyedBlock,
71 ::Actor* source
72 ) /*override*/;
73
74#ifdef LL_PLAT_S
75 virtual ::EventResult
76 onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool) /*override*/;
77#else // LL_PLAT_C
78 virtual ::EventResult onBlockPlacedByPlayer(
79 ::Player& player,
80 ::Block const& placedBlock,
81 ::BlockPos const& pos,
82 bool isUnderwater
83 ) /*override*/;
84#endif
85
86 virtual ::EventResult onBlockDestroyedByPlayer(
87 ::Player& player,
88 ::Block const& destroyedBlock,
89 ::BlockPos const& pos,
90 ::ItemStackBase const& currentItem,
91 ::ItemStackBase const& itemBeforeBlockBreak
92 ) /*override*/;
93
94 virtual ::EventResult onBlockDestructionStarted(
95 ::Player& player,
96 ::BlockPos const& pos,
97 ::Block const& hitBlock,
98 uchar const face,
99 int const previousProgress
100 ) /*override*/;
101
102 virtual ::EventResult
103 onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress) /*override*/;
104
105 virtual ::EventResult onBlockDestructionContinued(
106 ::Player& player,
107 ::BlockPos const& pos,
108 ::Block const& block,
109 uchar const face,
110 int const previousProgress
111 ) /*override*/;
112 // NOLINTEND
113
114public:
115 // virtual function thunks
116 // NOLINTBEGIN
117 MCAPI ::EventResult $onEvent(::PistonActionEvent const& eventData);
118
119 MCAPI ::EventResult $onEvent(::LeverActionEvent const& eventData);
120
121 MCAPI ::EventResult $onEvent(::ButtonPushEvent const& eventData);
122
123 MCAPI ::EventResult $onEvent(::PressurePlatePushEvent const& eventData);
124
125 MCAPI ::EventResult $onEvent(::PressurePlatePopEvent const& eventData);
126
127 MCAPI ::EventResult $onEvent(::TripWireTripEvent const& eventData);
128
129 MCAPI ::EventResult $onEvent(::TargetBlockHitEvent const& eventData);
130
131 MCAPI ::EventResult $onEvent(::ExplosionStartedEvent const& eventData);
132
133 MCAPI ::EventResult $onBlockExploded(
134 ::Dimension& dimension,
135 ::BlockPos const& blockPos,
136 ::Block const& destroyedBlock,
137 ::Actor* source
138 );
139
140#ifdef LL_PLAT_S
141 MCAPI ::EventResult
142 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool);
143#else // LL_PLAT_C
144 MCAPI ::EventResult
145 $onBlockPlacedByPlayer(::Player& player, ::Block const& placedBlock, ::BlockPos const& pos, bool isUnderwater);
146#endif
147
148 MCAPI ::EventResult $onBlockDestroyedByPlayer(
149 ::Player& player,
150 ::Block const& destroyedBlock,
151 ::BlockPos const& pos,
152 ::ItemStackBase const& currentItem,
153 ::ItemStackBase const& itemBeforeBlockBreak
154 );
155
156 MCAPI ::EventResult $onBlockDestructionStarted(
157 ::Player& player,
158 ::BlockPos const& pos,
159 ::Block const& hitBlock,
160 uchar const face,
161 int const previousProgress
162 );
163
164 MCAPI ::EventResult $onBlockDestructionStopped(::Player& player, ::BlockPos const& blockPos, int progress);
165
166 MCAPI ::EventResult $onBlockDestructionContinued(
167 ::Player& player,
168 ::BlockPos const& pos,
169 ::Block const& block,
170 uchar const face,
171 int const previousProgress
172 );
173
174
175 // NOLINTEND
176};
177
178} // namespace ScriptModuleMinecraft
Definition Actor.h:113
Definition BlockPos.h:17
Definition Block.h:41
Definition Dimension.h:86
Definition EventListenerDispatcher.h:6
Definition ItemStackBase.h:44
Definition Player.h:129
Definition ScriptBlockBreakingEventListener.h:17
Definition ScriptBlockGlobalEventListener.h:33
Definition ButtonPushEvent.h:14
Definition ExplosionStartedEvent.h:15
Definition LeverActionEvent.h:14
Definition PistonActionEvent.h:14
Definition PressurePlatePopEvent.h:13
Definition PressurePlatePushEvent.h:14
Definition TargetBlockHitEvent.h:15
Definition TripWireTripEvent.h:14