LeviLamina
Loading...
Searching...
No Matches
ScriptPlayerEventListener.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/legacy/ActorUniqueID.h"
9#include "mc/world/events/EventListenerDispatcher.h"
10#include "mc/world/events/EventResult.h"
11#include "mc/world/events/PlayerEventListener.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockPos;
16class Player;
19struct PlayerEmoteEvent;
33namespace ScriptModuleMinecraft { class IScriptWorldAfterEvents; }
34namespace ScriptModuleMinecraft { struct ScriptActorContainerAccessAfterEventIntermediateData; }
35namespace ScriptModuleMinecraft { struct ScriptBlockContainerAccessAfterEventIntermediateData; }
36// clang-format on
37
38namespace ScriptModuleMinecraft {
39
40class ScriptPlayerEventListener : public ::EventListenerDispatcher<::PlayerEventListener> {
41public:
42 // ScriptPlayerEventListener inner types define
43 using ContainerCloseContext = ::std::variant<
44 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptActorContainerAccessAfterEventIntermediateData>,
45 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptBlockContainerAccessAfterEventIntermediateData>>;
46
47public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 16, ::Scripting::WeakLifetimeScope> mScope;
51 ::ll::TypedStorage<8, 16, ::Scripting::TypedObjectHandle<::ScriptModuleMinecraft::IScriptWorldAfterEvents>>
52 mScriptEventsHandle;
53 ::ll::TypedStorage<
54 8,
55 64,
56 ::std::unordered_map<
58 ::std::variant<
59 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptActorContainerAccessAfterEventIntermediateData>,
60 ::std::shared_ptr<::ScriptModuleMinecraft::ScriptBlockContainerAccessAfterEventIntermediateData>>>>
61 mContainerCloseContextDataMap;
62 // NOLINTEND
63
64public:
65 // prevent constructor by default
66 ScriptPlayerEventListener();
67
68public:
69 // virtual functions
70 // NOLINTBEGIN
71 virtual ::EventResult onEvent(::PlayerRespawnEvent const& respawnEvent) /*override*/;
72
73 virtual ::EventResult onEvent(::PlayerInitialSpawnEvent const& initialSpawnEvent) /*override*/;
74
75 virtual ::EventResult onEvent(::PlayerDimensionChangeAfterEvent const& playerDimensionChangeEvent) /*override*/;
76
77 virtual ::EventResult onEvent(::PlayerInputModeChangeEvent const& playerInputModeChangeEvent) /*override*/;
78
79 virtual ::EventResult onEvent(::PlayerInputPermissionCategoryChangeEvent const& event) /*override*/;
80
81 virtual ::EventResult
82 onEvent(::PlayerInteractWithEntityAfterEvent const& playerInteractWithEntityEvent) /*override*/;
83
84 virtual ::EventResult onEvent(::PlayerInteractWithBlockAfterEvent const& playerInteractWithBlockEvent) /*override*/;
85
86 virtual ::EventResult onEvent(::PlayerGameModeChangeEvent const& playerGameModeChangeEvent) /*override*/;
87
88 virtual ::EventResult onEvent(::PlayerEmoteEvent const& playerEmoteEvent) /*override*/;
89
90 virtual ::EventResult onEvent(::PlayerScriptInputEvent const& e) /*override*/;
91
92 virtual ::EventResult onEvent(::PlayerInventoryItemChangeEvent const& e) /*override*/;
93
94 virtual ::EventResult onEvent(::PlayerHotbarSelectedSlotChangeEvent const& e) /*override*/;
95
96 virtual ::EventResult onEvent(::PlayerUseNameTagEvent const& nameTagEvent) /*override*/;
97
98 virtual ::EventResult onEvent(::PlayerSwingStartEvent const& e) /*override*/;
99
100 virtual ::EventResult onEvent(::PlayerOpenedContainerEvent const& e) /*override*/;
101
102 virtual ::EventResult onEvent(::PlayerClosedContainerEvent const& e) /*override*/;
103 // NOLINTEND
104
105public:
106 // member functions
107 // NOLINTBEGIN
108 MCAPI ScriptPlayerEventListener(
111 );
112
113 MCAPI void flushContainerCloseContext(::Player const& player);
114
115 MCAPI void onPlayerOpenedContainer(::Player const& player, ::BlockPos blockPos);
116
117 MCAPI void onPlayerOpenedContainer(::Player const& player, ::ActorUniqueID entityUniqueId);
118 // NOLINTEND
119
120public:
121 // constructor thunks
122 // NOLINTBEGIN
123 MCAPI void* $ctor(
126 );
127 // NOLINTEND
128
129public:
130 // virtual function thunks
131 // NOLINTBEGIN
132 MCAPI ::EventResult $onEvent(::PlayerRespawnEvent const& respawnEvent);
133
134 MCAPI ::EventResult $onEvent(::PlayerInitialSpawnEvent const& initialSpawnEvent);
135
136 MCAPI ::EventResult $onEvent(::PlayerDimensionChangeAfterEvent const& playerDimensionChangeEvent);
137
138 MCAPI ::EventResult $onEvent(::PlayerInputModeChangeEvent const& playerInputModeChangeEvent);
139
140 MCAPI ::EventResult $onEvent(::PlayerInputPermissionCategoryChangeEvent const& event);
141
142 MCAPI ::EventResult $onEvent(::PlayerInteractWithEntityAfterEvent const& playerInteractWithEntityEvent);
143
144 MCAPI ::EventResult $onEvent(::PlayerInteractWithBlockAfterEvent const& playerInteractWithBlockEvent);
145
146 MCAPI ::EventResult $onEvent(::PlayerGameModeChangeEvent const& playerGameModeChangeEvent);
147
148 MCAPI ::EventResult $onEvent(::PlayerEmoteEvent const& playerEmoteEvent);
149
150 MCAPI ::EventResult $onEvent(::PlayerScriptInputEvent const& e);
151
152 MCAPI ::EventResult $onEvent(::PlayerInventoryItemChangeEvent const& e);
153
154 MCAPI ::EventResult $onEvent(::PlayerHotbarSelectedSlotChangeEvent const& e);
155
156 MCAPI ::EventResult $onEvent(::PlayerUseNameTagEvent const& nameTagEvent);
157
158 MCAPI ::EventResult $onEvent(::PlayerSwingStartEvent const& e);
159
160 MCAPI ::EventResult $onEvent(::PlayerOpenedContainerEvent const& e);
161
162 MCAPI ::EventResult $onEvent(::PlayerClosedContainerEvent const& e);
163
164
165 // NOLINTEND
166
167public:
168 // vftables
169 // NOLINTBEGIN
170 MCNAPI static void** $vftable();
171 // NOLINTEND
172};
173
174} // namespace ScriptModuleMinecraft
Definition BlockPos.h:21
Definition EventListenerDispatcher.h:6
Definition Player.h:137
Definition IScriptWorldAfterEvents.h:73
Definition WeakLifetimeScope.h:14
Definition ActorUniqueID.h:10
Definition PlayerClosedContainerEvent.h:8
Definition PlayerDimensionChangeAfterEvent.h:15
Definition PlayerEmoteEvent.h:8
Definition PlayerGameModeChangeEvent.h:9
Definition PlayerHotbarSelectedSlotChangeEvent.h:9
Definition PlayerInitialSpawnEvent.h:13
Definition PlayerInputModeChangeEvent.h:14
Definition PlayerInputPermissionCategoryChangeEvent.h:9
Definition PlayerInteractWithBlockAfterEvent.h:15
Definition PlayerInteractWithEntityAfterEvent.h:14
Definition PlayerInventoryItemChangeEvent.h:9
Definition PlayerOpenedContainerEvent.h:11
Definition PlayerRespawnEvent.h:13
Definition PlayerScriptInputEvent.h:10
Definition PlayerSwingStartEvent.h:10
Definition PlayerUseNameTagEvent.h:14
Definition ScriptActorContainerAccessAfterEventIntermediateData.h:15
Definition ScriptBlockContainerAccessAfterEventIntermediateData.h:17
Definition TypedObjectHandle.h:8