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