LeviLamina
Loading...
Searching...
No Matches
LocalPlayer.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/Brightness.h"
7#include "mc/deps/core/math/Vec3.h"
8#include "mc/deps/core/string/HashedString.h"
9#include "mc/deps/core/utility/AutomaticID.h"
10#include "mc/deps/core/utility/NonOwnerPointer.h"
11#include "mc/deps/core/utility/pub_sub/Subscription.h"
12#include "mc/deps/shared_types/legacy/ContainerType.h"
13#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
14#include "mc/deps/shared_types/legacy/item/EquipmentSlot.h"
15#include "mc/network/packet/PlayerRespawnState.h"
16#include "mc/platform/UUID.h"
17#include "mc/world/actor/ActorEvent.h"
18#include "mc/world/actor/ActorInitializationMethod.h"
19#include "mc/world/actor/ActorResetRule.h"
20#include "mc/world/actor/bhave/BehaviorStatus.h"
21#include "mc/world/actor/player/BedSleepingResult.h"
22#include "mc/world/actor/player/Player.h"
23#include "mc/world/inventory/InventoryMenu.h"
24#include "mc/world/item/ItemStack.h"
25#include "mc/world/level/BlockPos.h"
26#include "mc/world/level/GameType.h"
27#include "mc/world/level/chunk/NetworkChunkSubscriber.h"
28
29// auto generated forward declare list
30// clang-format off
31class Actor;
33class BlockActor;
36class ChunkPos;
37class ChunkSource;
39class CompoundTag;
40class Container;
41class DataLoadHelper;
42class Dimension;
43class EntityContext;
45class IClientInstance;
46class IClientInstance;
49class InventoryMenu;
54class Packet;
57class SubChunkPos;
59class TextObjectRoot;
60struct ActorUniqueID;
61struct Brightness;
62struct INpcDialogueData;
63struct Tick;
64namespace Editor { class IEditorPlayer; }
65namespace MovementDataExtractionUtility { class SnapshotAccessor; }
66namespace OreUI { class GameplayRouteHandler; }
67namespace mce { class UUID; }
68// clang-format on
69
70class LocalPlayer : public ::Player {
71public:
72 // LocalPlayer inner types declare
73 // clang-format off
74 struct ContainerCloseInfo;
77 class RegionListener;
79 // clang-format on
80
81 // LocalPlayer inner types define
83 public:
84 // virtual functions
85 // NOLINTBEGIN
86 // vIndex: 0
87 virtual ~RegionListener() = default;
88
89 // vIndex: 1
90 virtual void onRegionDestroyed() = 0;
91 // NOLINTEND
92
93 public:
94 // virtual function thunks
95 // NOLINTBEGIN
96
97 // NOLINTEND
98 };
99
101 public:
102 // member variables
103 // NOLINTBEGIN
104 ::ll::TypedStorage<8, 8, int64> mEmoteButtonDownStartTime;
105 ::ll::TypedStorage<1, 1, bool> mIsExpediateSelectionActive;
106 // NOLINTEND
107 };
108
110 public:
111 // FellFromWorldHeightAchievementTracker inner types define
112 enum class FallState : uchar {
113 Falling = 0,
114 TickCheckAliveTicks = 1,
115 CheckForAlive = 2,
116 Done = 3,
117 };
118
119 public:
120 // member variables
121 // NOLINTBEGIN
122 ::ll::TypedStorage<1, 1, ::LocalPlayer::FellFromWorldHeightAchievementTracker::FallState> mState;
123 ::ll::TypedStorage<4, 4, int> mCheckAliveTicks;
124 ::ll::TypedStorage<1, 1, bool> mHasSentAchievement;
125 // NOLINTEND
126 };
127
129 public:
130 // member variables
131 // NOLINTBEGIN
132 ::ll::TypedStorage<1, 1, bool> mIsUndergroundCurrentTick;
133 ::ll::TypedStorage<1, 1, bool> mWasUndergroundPreviousTick;
134 ::ll::TypedStorage<1, 1, bool> mForceInitialEventingPropertyUpdate;
135 ::ll::TypedStorage<4, 12, ::BlockPos> mPreviousBlockPos;
136 ::ll::TypedStorage<1, 1, ::Brightness> mPreviousNaturalLightLevel;
137 // NOLINTEND
138 };
139
141 public:
142 // member variables
143 // NOLINTBEGIN
144 ::ll::TypedStorage<1, 1, ::SharedTypes::Legacy::ContainerType> mContainerTypeToClose;
145 ::ll::TypedStorage<1, 1, bool> mShouldCloseContainerScreen;
146 // NOLINTEND
147 };
148
149public:
150 // member variables
151 // NOLINTBEGIN
152 ::ll::TypedStorage<8, 112, ::InventoryMenu> mInventoryMenu;
153 ::ll::TypedStorage<4, 4, float> mPortalEffectTime;
154 ::ll::TypedStorage<4, 4, float> mOPortalEffectTime;
155 ::ll::TypedStorage<8, 16, ::LocalPlayer::EmoteExpediateData> mEmoteExpediateData;
156 ::ll::TypedStorage<4, 20, ::LocalPlayer::UndergroundTelemetryHeuristic> mUndergroundTelemetryHeuristic;
157 ::ll::TypedStorage<4, 12, ::LocalPlayer::FellFromWorldHeightAchievementTracker>
158 mFellFromWorldHeightAchievementTracker;
159 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mLowMemorySubscription;
160 ::ll::TypedStorage<8, 8, ::IClientInstance&> mClient;
161 ::ll::TypedStorage<4, 4, int> mCanCloseScreenOnHurtAfterTime;
162 ::ll::TypedStorage<4, 12, ::Vec3> mlastFrameDelta;
163 ::ll::TypedStorage<1, 1, bool> mEnablePortalEffect;
164 ::ll::TypedStorage<8, 152, ::ItemStack> mSentOffhandItem;
165 ::ll::TypedStorage<8, 152, ::ItemStack> mSentInventoryItem;
166 ::ll::TypedStorage<4, 4, int> mSentSelectedSlot;
167 ::ll::TypedStorage<1, 2, ::LocalPlayer::ContainerCloseInfo> mContainerCloseInfo;
168 ::ll::TypedStorage<8, 8, uint64> mSessionTickCount;
169 ::ll::TypedStorage<8, 24, ::std::vector<::LocalPlayer::RegionListener*>> mRegionListeners;
170 ::ll::TypedStorage<1, 1, bool> mDamagedByMobThisFrame;
171 ::ll::TypedStorage<1, 1, bool> mLeavingLevel;
172 ::ll::TypedStorage<1, 1, bool> mIsTeacher;
173 ::ll::TypedStorage<1, 1, bool> mHasBeenInitialized;
174 ::ll::TypedStorage<1, 1, bool> mPrevTransitionBlocking;
175 ::ll::TypedStorage<8, 32, ::std::string> mInventorySearchString;
176 ::ll::TypedStorage<8, 64, ::std::unordered_set<::mce::UUID>> mAllSentEmotePieceIds;
177 ::ll::TypedStorage<8, 48, ::HashedString> mCurrentStructureFeature;
178 ::ll::TypedStorage<8, 152, ::ItemStack> mItemActivationItem;
179 ::ll::TypedStorage<4, 4, int> mItemActivationTicks;
180 ::ll::TypedStorage<4, 4, float> mItemActivationOffsetX;
181 ::ll::TypedStorage<4, 4, float> mItemActivationOffsetY;
182 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerAutomationObserver>> mAutomationObserver;
183 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SubChunkRequestSubscriber>> mSubChunkSubscriber;
184 ::ll::TypedStorage<4, 4, uint> mTickingAreaChunkIndexToCheckForRequests;
185 ::ll::TypedStorage<8, 32, ::NetworkChunkSubscriber> mChunkSubscriberView;
186 ::ll::TypedStorage<1, 1, ::PlayerRespawnState> mClientRespawnState;
187 ::ll::TypedStorage<4, 12, ::Vec3> mClientRespawnPotentialPosition;
188 ::ll::TypedStorage<4, 4, int> mRenderChunkRadiusLowMemoryWatermark;
189 ::ll::TypedStorage<8, 32, ::std::string> mLastDeathInfo;
190 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::Editor::IEditorPlayer>> mEditorClientPlayer;
191 ::ll::TypedStorage<4, 4, float> mCurrentExpCache;
192 ::ll::TypedStorage<4, 4, int> mCurrentLevelCache;
193 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastLevelChangedTimePoint;
194 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastXPContainerClosedTimePoint;
195 ::ll::TypedStorage<1, 1, bool> mPreparedMainChunkSource;
196 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mVisibleTouchJoystickLockSubscription;
197 // NOLINTEND
198
199public:
200 // prevent constructor by default
201 LocalPlayer& operator=(LocalPlayer const&);
202 LocalPlayer(LocalPlayer const&);
203 LocalPlayer();
204
205public:
206 // virtual functions
207 // NOLINTBEGIN
208 // vIndex: 8
209 virtual ~LocalPlayer() /*override*/ = default;
210
211 // vIndex: 3
212 virtual void reloadHardcodedClient(::ActorInitializationMethod) /*override*/;
213
214 // vIndex: 178
215 virtual void prepareRegion(::ChunkSource& mainChunkSource) /*override*/;
216
217 // vIndex: 180
218 virtual void suspendRegion() /*override*/;
219
220 // vIndex: 179
221 virtual void destroyRegion() /*override*/;
222
223 // vIndex: 183
224 virtual void tickWorld(::Tick const&) /*override*/;
225
226 // vIndex: 184
227 virtual void frameUpdate(::FrameUpdateContextBase&) /*override*/;
228
229 // vIndex: 185
230 virtual ::std::vector<::ChunkPos> const& getTickingOffsets() const /*override*/;
231
232 // vIndex: 24
233 virtual void normalTick() /*override*/;
234
235 // vIndex: 27
236 virtual bool startRiding(::Actor& vehicle, bool forceRiding) /*override*/;
237
238 // vIndex: 146
239 virtual void aiStep() /*override*/;
240
241 // vIndex: 137
242 virtual void addAdditionalSaveData(::CompoundTag& tag) const /*override*/;
243
244 // vIndex: 136
245 virtual void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
246
247 // vIndex: 224
248 virtual void deleteContainerManager() /*override*/;
249
250 // vIndex: 194
251 virtual void openPortfolio() /*override*/;
252
253 // vIndex: 195
254 virtual void openBook(int, bool, int, ::BlockActor*) /*override*/;
255
256 // vIndex: 197
257 virtual void openChalkboard(::ChalkboardBlockActor&, bool) /*override*/;
258
259 // vIndex: 198
260 virtual void openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc) /*override*/;
261
262 // vIndex: 196
263 virtual void openTrading(::ActorUniqueID const&, bool) /*override*/;
264
265 // vIndex: 199
266 virtual void openInventory() /*override*/;
267
268 // vIndex: 221
269 virtual void setContainerData(::IContainerManager&, int, int) /*override*/;
270
271 // vIndex: 222
272 virtual void
273 slotChanged(::IContainerManager&, ::Container&, int, ::ItemStack const&, ::ItemStack const&, bool) /*override*/;
274
275 // vIndex: 223
276 virtual void refreshContainer(::IContainerManager&) /*override*/;
277
278 // vIndex: 211
279 virtual bool isLoading() const /*override*/;
280
281 // vIndex: 213
282 virtual void stopLoading() /*override*/;
283
284 // vIndex: 191
285 virtual void respawn() /*override*/;
286
287 // vIndex: 201
288 virtual void displayClientMessage(
289 ::std::string const& message,
290 ::std::optional<::std::string> const filteredMessage
291 ) /*override*/;
292
293 // vIndex: 202
294 virtual void displayTextObjectMessage(
295 ::TextObjectRoot const& textObject,
296 ::std::string const& fromXuid,
297 ::std::string const& fromPlatformId
298 ) /*override*/;
299
300 // vIndex: 205
301 virtual void displayWhisperMessage(
302 ::std::string const& author,
303 ::std::string const& message,
304 ::std::optional<::std::string> const filteredMessage,
305 ::std::string const& xuid,
306 ::std::string const& platformId
307 ) /*override*/;
308
309 // vIndex: 206
310 virtual ::BedSleepingResult startSleepInBed(::BlockPos const& bedBlockPos) /*override*/;
311
312 // vIndex: 207
313 virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList) /*override*/;
314
315 // vIndex: 208
316 virtual bool canStartSleepInBed() /*override*/;
317
318 // vIndex: 87
319 virtual void handleInsidePortal(::BlockPos const& portalPos) /*override*/;
320
321 // vIndex: 111
322 virtual bool swing() /*override*/;
323
324 // vIndex: 44
325 virtual void setSneaking(bool value) /*override*/;
326
327 // vIndex: 140
328 virtual void setSprinting(bool shouldSprint) /*override*/;
329
330 // vIndex: 210
331 virtual void playEmote(::std::string const&, bool const) /*override*/;
332
333 // vIndex: 192
334 virtual void resetRot() /*override*/;
335
336 // vIndex: 9
337 virtual void resetUserPos(::ActorResetRule) /*override*/;
338
339 // vIndex: 21
340 virtual void teleportTo(::Vec3 const&, bool, int, int, bool) /*override*/;
341
342 // vIndex: 90
343 virtual void changeDimension(::DimensionType toId) /*override*/;
344
345 // vIndex: 89
346 virtual void changeDimension(::ChangeDimensionPacket const&) /*override*/;
347
348 // vIndex: 214
349 virtual void setPlayerGameType(::GameType gameType) /*override*/;
350
351 // vIndex: 91
352 virtual ::ActorUniqueID getControllingPlayer() const /*override*/;
353
354 // vIndex: 181
355 virtual void _fireDimensionChanged() /*override*/;
356
357 // vIndex: 190
358 virtual bool isAutoJumpEnabled() const /*override*/;
359
360 // vIndex: 170
361 virtual bool setItemSlot(::SharedTypes::Legacy::EquipmentSlot slot, ::ItemStack const& item) /*override*/;
362
363 // vIndex: 79
364 virtual void setOffhandSlot(::ItemStack const& item) /*override*/;
365
366 // vIndex: 72
367 virtual void setArmor(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) /*override*/;
368
369 // vIndex: 217
370 virtual ::IMinecraftEventing* getEventing() const /*override*/;
371
372 // vIndex: 218
373 virtual uint getUserId() const /*override*/;
374
375 // vIndex: 193
376 virtual bool isInTrialMode() /*override*/;
377
378 // vIndex: 242
379 virtual void setAbilities(::LayeredAbilities const& newAbilities) /*override*/;
380
381 // vIndex: 123
382 virtual void die(::ActorDamageSource const& source) /*override*/;
383
384 // vIndex: 107
385 virtual void onEffectRemoved(::MobEffectInstance& effect) /*override*/;
386
387 // vIndex: 219
388 virtual void addExperience(int xp) /*override*/;
389
390 // vIndex: 220
391 virtual void addLevels(int levels) /*override*/;
392
393 // vIndex: 225
394 virtual bool isActorRelevant(::Actor const&) /*override*/;
395
396 // vIndex: 69
397 virtual void handleEntityEvent(::ActorEvent eventId, int data) /*override*/;
398
399 // vIndex: 188
400 virtual void checkMovementStats(::Vec3 const&) /*override*/;
401
402 // vIndex: 189
403 virtual ::HashedString getCurrentStructureFeature() const /*override*/;
404
405 // vIndex: 226
406 virtual bool isTeacher() const /*override*/;
407
408 // vIndex: 229
409 virtual void sendInventoryTransaction(::InventoryTransaction const&) const /*override*/;
410
411 // vIndex: 230
412 virtual void sendComplexInventoryTransaction(::std::unique_ptr<::ComplexInventoryTransaction>) const /*override*/;
413
414 // vIndex: 231
415 virtual void sendNetworkPacket(::Packet& packet) const /*override*/;
416
417 // vIndex: 232
418 virtual ::PlayerEventCoordinator& getPlayerEventCoordinator() /*override*/;
419
420 // vIndex: 125
421 virtual void applySnapshot(
422 ::EntityContext const& snapshotEntity,
423 ::MovementDataExtractionUtility::SnapshotAccessor const& originalSnapshotEntity
424 ) /*override*/;
425
426 // vIndex: 244
427 virtual void destroyEditorPlayer() /*override*/;
428
429 // vIndex: 243
430 virtual ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> getEditorPlayer() const /*override*/;
431
432 // vIndex: 236
433 virtual void requestMissingSubChunk(::SubChunkPos const&) /*override*/;
434
435 // vIndex: 237
436 virtual uchar getMaxChunkBuildRadius() const /*override*/;
437
438 // vIndex: 238
439 virtual void setBehaviorCommandStatus(::std::string const&, ::BehaviorStatus) /*override*/;
440
441 // vIndex: 216
442 virtual void _crit(::Actor& actor) /*override*/;
443
444 // vIndex: 135
445 virtual bool _hurt(::ActorDamageSource const&, float, bool, bool) /*override*/;
446 // NOLINTEND
447
448public:
449 // virtual function thunks
450 // NOLINTBEGIN
451
452 // NOLINTEND
453};
Definition ActorDamageSource.h:18
Definition Actor.h:102
Definition AutomaticID.h:6
Definition BlockActor.h:32
Definition BlockPos.h:17
Definition ChalkboardBlockActor.h:24
Definition ChangeDimensionPacket.h:19
Definition ChunkPos.h:11
Definition ChunkSource.h:34
Definition ComplexInventoryTransaction.h:19
Definition CompoundTag.h:13
Definition Container.h:31
Definition DataLoadHelper.h:20
Definition Dimension.h:83
Definition EntityContext.h:16
Definition FrameUpdateContextBase.h:5
Definition HashedString.h:5
Definition IClientInstance.h:186
Definition IContainerManager.h:16
Definition IMinecraftEventing.h:147
Definition InventoryMenu.h:17
Definition InventoryTransaction.h:21
Definition ItemStack.h:23
Definition LayeredAbilities.h:18
Definition LocalPlayer.h:100
Definition LocalPlayer.h:82
Definition LocalPlayer.h:128
Definition LocalPlayer.h:70
Definition MobEffectInstance.h:15
Definition NetworkChunkSubscriber.h:13
Definition Packet.h:43
Definition PlayerAutomationObserver.h:5
Definition PlayerEventCoordinator.h:22
Definition Player.h:123
Definition SubChunkPos.h:5
Definition SubChunkRequestSubscriber.h:13
Definition TextObjectRoot.h:14
Definition Vec3.h:10
STL namespace.
Definition ActorUniqueID.h:5
Definition Brightness.h:8
Definition INpcDialogueData.h:12
Definition LocalPlayer.h:140
Definition Tick.h:5