LeviLamina
Loading...
Searching...
No Matches
GameMode.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/input/InputMode.h"
7
8// auto generated forward declare list
9// clang-format off
10class Actor;
11class Block;
12class BlockPos;
13class HitResult;
15class ItemStack;
16class Player;
17class Vec3;
19struct IGameModeTimer;
20// clang-format on
21
22class GameMode {
23public:
24 // GameMode inner types declare
25 // clang-format off
26 struct BuildContext;
27 struct BuildDelay;
28 struct BuildPlayerContext;
29 struct ContinueBuildData;
30 // clang-format on
31
32 // GameMode inner types define
33 struct BuildContext {
34 public:
35 // member variables
36 // NOLINTBEGIN
46 // NOLINTEND
47
48 public:
49 // prevent constructor by default
50 BuildContext& operator=(BuildContext const&);
53 };
54
55 struct BuildDelay {
56 public:
57 // member variables
58 // NOLINTBEGIN
61 // NOLINTEND
62
63 public:
64 // prevent constructor by default
65 BuildDelay& operator=(BuildDelay const&);
66 BuildDelay(BuildDelay const&);
67 BuildDelay();
68 };
69
71 public:
72 // member variables
73 // NOLINTBEGIN
76 // NOLINTEND
77
78 public:
79 // prevent constructor by default
80 ContinueBuildData& operator=(ContinueBuildData const&);
83 };
84
86 public:
87 // member variables
88 // NOLINTBEGIN
91 // NOLINTEND
92
93 public:
94 // prevent constructor by default
95 BuildPlayerContext& operator=(BuildPlayerContext const&);
98 };
99
100public:
101 // member variables
102 // NOLINTBEGIN
103 ::ll::TypedStorage<8, 8, ::Player&> mPlayer;
104 ::ll::TypedStorage<4, 12, ::BlockPos> mDestroyBlockPos;
105 ::ll::TypedStorage<1, 1, uchar> mDestroyBlockFace;
106 ::ll::TypedStorage<4, 4, float> mOldDestroyProgress;
107 ::ll::TypedStorage<4, 4, float> mDestroyProgress;
108 ::ll::TypedStorage<8, 8, double> mLastDestroyTime;
109 ::ll::TypedStorage<4, 4, float> mDistanceTravelled;
110 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerLastPosition;
111 ::ll::TypedStorage<4, 56, ::GameMode::BuildContext> mBuildContext;
112 ::ll::TypedStorage<4, 4, float> mMinPlayerSpeed;
113 ::ll::TypedStorage<4, 4, int> mContinueBreakBlockCount;
114 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastBuildTime;
115 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroyUntil;
116 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNoDestroySoundUntil;
117 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> creativeDestructionTickDelay;
118 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> buildingTickDelay;
119 ::ll::TypedStorage<8, 8, ::std::chrono::milliseconds> destroySoundDelay;
120 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeTimer>> mTimer;
121 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IGameModeMessenger>> mMessenger;
122 // NOLINTEND
123
124public:
125 // virtual functions
126 // NOLINTBEGIN
127 // vIndex: 0
128 virtual ~GameMode() = default;
129
130 // vIndex: 1
131 virtual bool startDestroyBlock(::BlockPos const& pos, uchar face, bool& hasDestroyedBlock);
132
133 // vIndex: 2
134 virtual bool destroyBlock(::BlockPos const& pos, uchar face);
135
136 // vIndex: 3
137 virtual bool
138 continueDestroyBlock(::BlockPos const& pos, uchar face, ::Vec3 const& playerPos, bool& hasDestroyedBlock);
139
140 // vIndex: 4
141 virtual void stopDestroyBlock(::BlockPos const& pos);
142
143 // vIndex: 5
144 virtual void startBuildBlock(::BlockPos const& pos, uchar face);
145
146 // vIndex: 6
147 virtual bool buildBlock(::BlockPos const& pos, uchar face, bool const isSimTick);
148
149 // vIndex: 7
150 virtual void continueBuildBlock(::BlockPos const& pos, uchar face);
151
152 // vIndex: 8
153 virtual void stopBuildBlock();
154
155 // vIndex: 9
156 virtual void tick();
157
158 // vIndex: 10
159 virtual float getPickRange(::InputMode const& currentInputMode, bool isVR);
160
161 // vIndex: 11
162 virtual bool useItem(::ItemStack& item);
163
164 // vIndex: 12
165 virtual ::InteractionResult useItemOn(
166 ::ItemStack& item,
167 ::BlockPos const& at,
168 uchar face,
169 ::Vec3 const& hit,
170 ::Block const* targetBlock,
171 bool isFirstEvent
172 );
173
174 // vIndex: 13
175 virtual bool interact(::Actor& entity, ::Vec3 const& location);
176
177 // vIndex: 14
178 virtual bool attack(::Actor& entity);
179
180 // vIndex: 15
181 virtual void releaseUsingItem();
182
183 // vIndex: 16
184 virtual void setTrialMode(bool isEnabled);
185
186 // vIndex: 17
187 virtual bool isInTrialMode();
188
189 // vIndex: 18
190 virtual void registerUpsellScreenCallback(::std::function<void(bool)> callback);
191 // NOLINTEND
192
193public:
194 // member functions
195 // NOLINTBEGIN
196 MCAPI GameMode(
197 ::Player& player,
198 ::std::unique_ptr<::IGameModeTimer> timer,
199 ::std::unique_ptr<::IGameModeMessenger> messenger
200 );
201
202 MCAPI bool _attack(::Actor& entity, bool playPredictiveSound);
203
204 MCAPI ::BlockPos _calculatePlacePos(::ItemStack& heldStack, ::BlockPos const& pos, uchar& face) const;
205
206 MCAPI bool _canDestroy(::BlockPos const& pos, uchar face);
207
208 MCAPI bool _canUseBlock(::Block const& block);
209
210 MCAPI bool _creativeDestroyBlock(::BlockPos const& pos, uchar face);
211
212 MCAPI void _destroyBlockInternal(::BlockPos const& pos, ::Block const& oldBlock, ::Block const& newBlock) const;
213
214 MCAPI bool _enableBlockBreakDelay() const;
215
216 MCAPI void _sendPlayerInteractWithBlockAfterEvent(
217 ::ItemStack const& beforeItem,
218 ::ItemStack const& afterItem,
219 ::Player& player,
220 ::BlockPos const& at,
221 uchar face,
222 ::Vec3 const& hit,
223 bool isFirstEvent
224 );
225
226 MCAPI void _sendPlayerInteractWithEntityAfterEvent(
227 ::ItemStack const& beforeItem,
228 ::ItemStack const& afterItem,
229 ::Player& player,
230 ::Actor const& entity
231 );
232
233 MCAPI ::std::optional<::ItemStack>
234 _sendTryDestroyBlockEvent(::Block const& block, ::BlockPos const& pos, ::ItemStack itemBeforeEvent) const;
235
236 MCAPI ::InteractionResult
237 _sendUseItemOnEvents(::ItemStack& item, ::BlockPos const& at, uchar face, ::Vec3 const& hit, bool isFirstEvent)
238 const;
239
240 MCAPI bool baseUseItem(::ItemStack& item);
241
242 MCAPI void continueBuildBlockAction(::Player const& player, ::HitResult const& hr);
243
244 MCAPI float getDestroyRate(::Block const& block);
245
246 MCAPI float getMaxPickRange();
247 // NOLINTEND
248
249public:
250 // static variables
251 // NOLINTBEGIN
252 MCAPI static float const& MIN_MOVING_NON_CREATIVE_BUILD_DELAY();
253 // NOLINTEND
254
255public:
256 // constructor thunks
257 // NOLINTBEGIN
258 MCAPI void* $ctor(
259 ::Player& player,
260 ::std::unique_ptr<::IGameModeTimer> timer,
261 ::std::unique_ptr<::IGameModeMessenger> messenger
262 );
263 // NOLINTEND
264
265public:
266 // destructor thunk
267 // NOLINTBEGIN
268
269 // NOLINTEND
270
271public:
272 // virtual function thunks
273 // NOLINTBEGIN
274 MCAPI bool $startDestroyBlock(::BlockPos const& pos, uchar face, bool& hasDestroyedBlock);
275
276 MCAPI bool $destroyBlock(::BlockPos const& pos, uchar face);
277
278 MCAPI bool
279 $continueDestroyBlock(::BlockPos const& pos, uchar face, ::Vec3 const& playerPos, bool& hasDestroyedBlock);
280
281 MCAPI void $stopDestroyBlock(::BlockPos const& pos);
282
283 MCAPI void $startBuildBlock(::BlockPos const& pos, uchar face);
284
285 MCAPI bool $buildBlock(::BlockPos const& pos, uchar face, bool const isSimTick);
286
287 MCAPI void $continueBuildBlock(::BlockPos const& pos, uchar face);
288
289 MCAPI void $stopBuildBlock();
290
291 MCAPI void $tick();
292
293 MCAPI float $getPickRange(::InputMode const& currentInputMode, bool isVR);
294
295 MCAPI bool $useItem(::ItemStack& item);
296
297 MCAPI ::InteractionResult $useItemOn(
298 ::ItemStack& item,
299 ::BlockPos const& at,
300 uchar face,
301 ::Vec3 const& hit,
302 ::Block const* targetBlock,
303 bool isFirstEvent
304 );
305
306 MCAPI bool $interact(::Actor& entity, ::Vec3 const& location);
307
308 MCAPI bool $attack(::Actor& entity);
309
310 MCAPI void $releaseUsingItem();
311
312 MCFOLD void $setTrialMode(bool isEnabled);
313
314 MCFOLD bool $isInTrialMode();
315
316 MCFOLD void $registerUpsellScreenCallback(::std::function<void(bool)> callback);
317 // NOLINTEND
318
319public:
320 // vftables
321 // NOLINTBEGIN
322 MCAPI static void** $vftable();
323 // NOLINTEND
324};
Definition Actor.h:104
Definition BlockPos.h:18
Definition Block.h:36
Definition GameMode.h:22
Definition HitResult.h:19
Definition InteractionResult.h:5
Definition ItemStack.h:25
Definition Player.h:119
Definition Vec3.h:10
Definition GameMode.h:33
Definition GameMode.h:55
Definition GameMode.h:85
Definition GameMode.h:70
Definition IGameModeMessenger.h:12
Definition IGameModeTimer.h:5
Definition Alias.h:14