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