LeviLamina
Loading...
Searching...
No Matches
Player.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4#include "mc/deps/certificates/Certificate.h"
5#include "mc/entity/components/UserEntityIdentifierComponent.h"
6#include "mc/network/NetworkPeer.h"
7#include "mc/world/inventory/EnderChestContainer.h"
8
9// auto generated inclusion list
10#include "mc/certificates/identity/PlayerAuthenticationType.h"
11#include "mc/common/SubClientId.h"
12#include "mc/deps/core/math/Vec3.h"
13#include "mc/deps/core/platform/BuildPlatform.h"
14#include "mc/deps/core/timing/Stopwatch.h"
15#include "mc/deps/core/utility/NonOwnerPointer.h"
16#include "mc/deps/core/utility/optional_ref.h"
17#include "mc/deps/core/utility/pub_sub/Publisher.h"
18#include "mc/deps/game_refs/OwnerPtr.h"
19#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
20#include "mc/deps/shared_types/legacy/actor/ActorDamageCause.h"
21#include "mc/deps/shared_types/legacy/actor/ArmorSlot.h"
22#include "mc/entity/components/PlayerPositionModeComponent.h"
23#include "mc/legacy/ActorUniqueID.h"
24#include "mc/server/commands/CommandPermissionLevel.h"
25#include "mc/server/commands/PlayerPermissionLevel.h"
26#include "mc/world/PlayerUIContainer.h"
27#include "mc/world/actor/ActorEvent.h"
28#include "mc/world/actor/ActorInitializationMethod.h"
29#include "mc/world/actor/ActorResetRule.h"
30#include "mc/world/actor/ActorType.h"
31#include "mc/world/actor/Mob.h"
32#include "mc/world/actor/bhave/BehaviorStatus.h"
33#include "mc/world/actor/player/AbilitiesIndex.h"
34#include "mc/world/actor/player/BedSleepingResult.h"
35#include "mc/world/actor/player/PlayerItemInUse.h"
36#include "mc/world/actor/player/PlayerSpawnFallbackType.h"
37#include "mc/world/actor/player/PlayerUISlot.h"
38#include "mc/world/inventory/FurnaceOptions.h"
39#include "mc/world/inventory/InventoryOptions.h"
40#include "mc/world/inventory/transaction/InventoryTransactionManager.h"
41#include "mc/world/item/HandSlot.h"
42#include "mc/world/item/ItemGroup.h"
43#include "mc/world/item/ItemInstance.h"
44#include "mc/world/item/ItemUseMethod.h"
45#include "mc/world/level/BlockPos.h"
46#include "mc/world/level/GameType.h"
47#include "mc/world/level/dimension/DimensionType.h"
48
49// auto generated forward declare list
50// clang-format off
51class AABB;
52class Actor;
54class ActorHurtResult;
55class Agent;
57class Attribute;
58class Block;
59class BlockActor;
60class BlockSource;
61class BodyControl;
63class ChunkPos;
64class ChunkSource;
65class ChunkViewSource;
67class CompoundTag;
68class Container;
71class DataLoadHelper;
73class EntityContext;
74class GameMode;
76class HashedString;
80class ILevel;
85class Item;
86class ItemDescriptor;
87class ItemStack;
88class ItemStackBase;
94class Packet;
95class PacketSender;
96class PersonaPiece;
98class PlayerInventory;
102class SubChunkPos;
103class TextObjectRoot;
104class Vec2;
105struct AABBShapeComponent;
107struct BiomeIdType;
108struct HurtParameters;
109struct INpcDialogueData;
113struct PlayerPartyInfo;
116struct Tick;
118namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
119namespace Editor { class IEditorPlayer; }
120namespace mce { class Color; }
121namespace mce { class UUID; }
123class PlayerListener;
124// clang-format on
125
127class Inventory;
128
129class Player : public ::Mob {
130public:
131 // Player inner types declare
132 // clang-format off
133 struct AttackParameters;
134 struct CachedSpawnData;
137 struct PlayerSpawnPoint;
138 // clang-format on
139
140 // Player inner types define
141 enum class SpawnPositionSource : int {
142 Randomizer = 0,
143 Respawn = 1,
144 Teleport = 2,
145 Static = 3,
146 };
147
148 enum class SpawnPositionState : int {
149 InitializeSpawnPositionRandomizer = 0,
150 WaitForClientAck = 1,
151 DetermineDimension = 2,
152 ChangeDimension = 3,
153 WaitForDimension = 4,
154 ChooseSpawnArea = 5,
155 CheckLoadedChunk = 6,
156 ChooseSpawnPosition = 7,
157 SpawnComplete = 8,
158 };
159
161 public:
162 // AttackParameters inner types define
163 enum class Sound : int {
164 None = 0,
165 Predictive = 1,
166 NonPredictive = 2,
167 };
168
169 public:
170 // member variables
171 // NOLINTBEGIN
172 ::ll::TypedStorage<4, 4, ::Player::AttackParameters::Sound> mSound;
173 ::ll::TypedStorage<1, 1, bool> mTriggerCooldown;
174 ::ll::TypedStorage<1, 1, bool> mCanCrit;
175 ::ll::TypedStorage<4, 16, ::std::optional<::Vec3>> mAimDirection;
176 // NOLINTEND
177 };
178
180 public:
181 // member variables
182 // NOLINTBEGIN
183 ::ll::TypedStorage<4, 4, ::DimensionType> mRespawnDimensionId;
184 ::ll::TypedStorage<4, 12, ::Vec3> mActualRespawnPosition;
185 ::ll::TypedStorage<4, 12, ::BlockPos> mRequestedRespawnPosition;
186 ::ll::TypedStorage<1, 1, bool> mHasRespawnPosition;
187 ::ll::TypedStorage<4, 12, ::BlockPos> mSharedSpawnPosition;
188 ::ll::TypedStorage<1, 1, bool> mRespawnReady;
189 ::ll::TypedStorage<4, 12, ::Vec3> mPlayerPos;
190 ::ll::TypedStorage<1, 1, bool> mIsForcedRespawn;
191 ::ll::TypedStorage<1, 1, bool> mIsAdventure;
192 ::ll::TypedStorage<1, 1, bool> mIsFlyingOrNotOverworld;
193 ::ll::TypedStorage<1, 1, bool> mPositionLoadedFromSave;
194 // NOLINTEND
195 };
196
198 public:
199 // member variables
200 // NOLINTBEGIN
201 ::ll::TypedStorage<4, 12, ::Vec3> mPosition;
202 ::ll::TypedStorage<4, 4, ::PlayerSpawnFallbackType> mSpawnFallbackType;
203 // NOLINTEND
204 };
205
207 public:
208 // member variables
209 // NOLINTBEGIN
210 ::ll::TypedStorage<4, 12, ::Vec3> mPosition;
211 ::ll::TypedStorage<1, 1, bool> mIsAboveLeaves;
212 // NOLINTEND
213 };
214
216 public:
217 // member variables
218 // NOLINTBEGIN
219 ::ll::TypedStorage<4, 12, ::BlockPos> mSpawnBlockPos;
220 ::ll::TypedStorage<4, 12, ::BlockPos> mPlayerPosition;
221 ::ll::TypedStorage<4, 4, ::DimensionType> mDimension;
222 // NOLINTEND
223 };
224
225 using PlayerFlagIDType = schar;
226
227 using PlayerListenerList = ::std::vector<::PlayerListener*>;
228
229public:
230 LLNDAPI UserEntityIdentifierComponent const& getUserEntityIdentifier() const;
231
232 LLNDAPI UserEntityIdentifierComponent& getUserEntityIdentifier();
233
234 LLNDAPI optional_ref<ConnectionRequest const> getConnectionRequest() const;
235
236 LLNDAPI NetworkIdentifier const& getNetworkIdentifier() const;
237
238 LLNDAPI SubClientId const& getClientSubId() const;
239
240 LLNDAPI int getSelectedItemSlot() const;
241
246 LLNDAPI mce::UUID const& getUuid() const;
247
252 LLNDAPI std::string getIPAndPort() const;
253
258 LLNDAPI std::string getRealName() const;
259
266 LLNDAPI std::string getLocaleCode() const;
267
268 LLNDAPI std::optional<NetworkPeer::NetworkStatus> getNetworkStatus() const;
269
273 LLAPI void disconnect(std::string_view reason) const;
277 LLAPI void sendMessage(std::string_view msg) const;
278
279 LLAPI void setAbility(::AbilitiesIndex index, bool value);
280
288 LLNDAPI bool isOperator() const;
289
300 LLAPI bool addAndRefresh(class ItemStack& item);
301
302 LLNDAPI optional_ref<EnderChestContainer> getEnderChestContainer() const;
303
304 LLNDAPI Inventory& getInventory() const;
305
306 LLNDAPI static Player* tryGetFromEntity(::EntityContext& entity, bool includeRemoved);
307
308 LLNDAPI ItemStack const& getSelectedItem() const;
309
310 LLAPI void setSelectedItem(ItemStack const& item) const;
311
312 LLNDAPI bool canSleep() const;
313
314 LLNDAPI bool isHungry() const;
315
316 LLNDAPI int getXpNeededForNextLevel();
317
318 LLNDAPI int getPreviousLevelRequirement();
319
320 LLNDAPI int getXpEarnedAtCurrentLevel();
321
322 LLNDAPI bool setXpEarnedAtCurrentLevel(int xp);
323
324 LLNDAPI static long long getXpNeededForLevelRange(int startLevel, int endLevel);
325
326public:
327 // member variables
328 // NOLINTBEGIN
329 ::ll::TypedStorage<8, 24, ::std::vector<ushort>> mFroglights;
330 ::ll::TypedStorage<4, 4, float const> mSneakHeight;
331 ::ll::TypedStorage<4, 4, float const> mSneakOffset;
332 ::ll::TypedStorage<4, 4, int> mScore;
333 ::ll::TypedStorage<4, 4, ::BuildPlatform> mBuildPlatform;
334 ::ll::TypedStorage<8, 32, ::std::string> mUniqueName;
335 ::ll::TypedStorage<8, 32, ::std::string> mServerId;
336 ::ll::TypedStorage<8, 32, ::std::string> mSelfSignedId;
337 ::ll::TypedStorage<8, 32, ::std::string> mPlatformOfflineId;
338 ::ll::TypedStorage<8, 8, uint64> mClientRandomId;
339 ::ll::TypedStorage<8, 32, ::std::string> mPlatformId;
340 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingVehicleID;
341 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingLeftShoulderPassengerID;
342 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPendingRightShoulderPassengerID;
343 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mInteractTarget;
344 ::ll::TypedStorage<4, 12, ::Vec3> mInteractTargetPos;
345 ::ll::TypedStorage<1, 1, bool> mHasFakeInventory;
346 ::ll::TypedStorage<1, 1, bool> mIsRegionSuspended;
347 ::ll::TypedStorage<1, 1, bool> mUpdateMobs;
348 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ChunkViewSource>> mChunkSource;
349 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ChunkViewSource>> mSpawnChunkSource;
350 ::ll::TypedStorage<4, 12, ::Vec3> mCapePosO;
351 ::ll::TypedStorage<4, 12, ::Vec3> mCapePos;
352 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerManagerModel>> mContainerManager;
353 ::ll::TypedStorage<
354 8,
355 8,
356 ::std::unique_ptr<
357 ::Bedrock::PubSub::
359 mContainerManagerSubscribers;
360 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerInventory>> mInventory;
361 ::ll::TypedStorage<4, 20, ::InventoryOptions> mInventoryOptions;
362 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mFurnaceOptions;
363 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mBlastFurnaceOptions;
364 ::ll::TypedStorage<4, 12, ::FurnaceOptions> mSmokerOptions;
365 ::ll::TypedStorage<4, 4, float> mDistanceSinceTransformEvent;
366 ::ll::TypedStorage<8, 24, ::std::vector<::ItemInstance>> mCreativeItemList;
367 ::ll::TypedStorage<8, 32, ::std::string> mPlatformOnlineId;
368 ::ll::TypedStorage<4, 4, ::Player::SpawnPositionState> mSpawnPositionState;
369 ::ll::TypedStorage<4, 4, ::Player::SpawnPositionSource> mSpawnPositionSource;
370 ::ll::TypedStorage<4, 12, ::Vec3> mSpawnPositioningTestPosition;
371 ::ll::TypedStorage<4, 4, uint> mRespawnChunkBuilderPolicyHandle;
372 ::ll::TypedStorage<4, 64, ::Player::CachedSpawnData> mCachedSpawnData;
373 ::ll::TypedStorage<8, 16, ::OwnerPtr<::BlockSource>> mSpawnBlockSource;
374 ::ll::TypedStorage<8, 56, ::Stopwatch> mRespawnStopwatch_Searching;
375 ::ll::TypedStorage<4, 12, ::Vec3> mRespawnOriginalPosition;
376 ::ll::TypedStorage<4, 4, ::DimensionType> mRespawnOriginalDimension;
377 ::ll::TypedStorage<8, 32, ::std::string> mRespawnMessage;
378 ::ll::TypedStorage<1, 1, bool> mRespawnReady;
379 ::ll::TypedStorage<1, 1, bool> mIsInitialSpawnDone;
380 ::ll::TypedStorage<1, 1, bool> mRespawningFromTheEnd;
381 ::ll::TypedStorage<1, 1, bool> mPositionLoadedFromSave;
382 ::ll::TypedStorage<1, 1, bool> mBlockRespawnUntilClientMessage;
383 ::ll::TypedStorage<1, 1, bool> mHasSeenCredits;
384 ::ll::TypedStorage<4, 8, ::std::optional<::PlayerSpawnFallbackType>> mSpawnFallbackType;
385 ::ll::TypedStorage<4, 16, ::std::optional<::Vec3>> mSpawnFallbackPosition;
386 ::ll::TypedStorage<8, 168, ::PlayerItemInUse> mItemInUse;
387 ::ll::TypedStorage<4, 4, ::ActorType> mLastHurtBy;
388 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mPreviousInteractEntity;
389 ::ll::TypedStorage<4, 4, int> mPreviousCarriedItem;
390 ::ll::TypedStorage<4, 4, int> mEmoteTicks;
391 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::NetworkChunkPublisher>> mChunkPublisherView;
392 ::ll::TypedStorage<8, 8, ::PacketSender&> mPacketSender;
393 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::HudContainerManagerModel>> mHudContainerManagerModel;
394 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::EnderChestContainer>> mEnderChestInventory;
395 ::ll::TypedStorage<8, 24, ::std::vector<::ActorUniqueID>> mTrackedBossIDs;
396 ::ll::TypedStorage<8, 136, ::ItemGroup> mCursorSelectedItemGroup;
397 ::ll::TypedStorage<8, 440, ::PlayerUIContainer> mPlayerUIContainer;
398 ::ll::TypedStorage<8, 48, ::InventoryTransactionManager> mTransactionManager;
399 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameMode>> mGameMode;
400 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerRespawnRandomizer>> mSpawnRandomizer;
401 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SerializedSkinRef>> mSkin;
402 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemStackNetManagerBase>> mItemStackNetManager;
403 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mUIAnimationComponent;
404 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mMapAnimationComponent;
405 ::ll::TypedStorage<4, 28, ::Player::PlayerSpawnPoint> mPlayerRespawnPoint;
406 ::ll::TypedStorage<4, 4, float> mServerBuildRatio;
407 ::ll::TypedStorage<1, 1, ::SubClientId> mClientId;
408 ::ll::TypedStorage<1, 1, bool> mInteractDataDirty;
409 ::ll::TypedStorage<1, 1, bool> mShouldClientGenerateChunks;
410 ::ll::TypedStorage<8, 24, ::std::vector<::BiomeIdType>> mOceanBiomes;
411 ::ll::TypedStorage<1, 1, bool> mUseMapAnimationComponent;
412 ::ll::TypedStorage<1, 1, bool> mIsDeferredRenderingFirstPersonObjects;
413 ::ll::TypedStorage<1, 1, bool> mDestroyingBlock;
414 ::ll::TypedStorage<1, 1, bool> mPlayerLevelChanged;
415 ::ll::TypedStorage<4, 4, int> mPreviousLevelRequirement;
416 ::ll::TypedStorage<4, 4, int> mLastLevelUpTime;
417 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::AnimationComponent>> mFirstPersonAnimationComponent;
418 ::ll::TypedStorage<8, 24, ::std::vector<::PlayerListener*>> mListeners;
419 ::ll::TypedStorage<4, 12, ::Vec3> mRespawnPositionCandidate;
420 ::ll::TypedStorage<4, 12, ::Vec3> mPreDimensionTransferSpawnPosition;
421 ::ll::TypedStorage<4, 4, int> mEnchantmentSeed;
422 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mOnScreenAnimationTextures;
423 ::ll::TypedStorage<4, 4, int> mOnScreenAnimationTicks;
424 ::ll::TypedStorage<4, 4, uint> mChunkRadius;
425 ::ll::TypedStorage<4, 4, int> mMapIndex;
426 ::ll::TypedStorage<4, 4, float> mElytraVolume;
427 ::ll::TypedStorage<8, 8, uint64> mElytraLoop;
428 ::ll::TypedStorage<8, 8, int64> mStartedBlockingTimeStamp;
429 ::ll::TypedStorage<8, 8, int64> mBlockedUsingShieldTimeStamp;
430 ::ll::TypedStorage<8, 8, int64> mBlockedUsingDamagedShieldTimeStamp;
431 ::ll::TypedStorage<8, 32, ::std::string> mName;
432 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatNamePrefix;
433 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatNameSuffix;
434 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mChatMessagePrefix;
435 ::ll::TypedStorage<8, 32, ::std::string> mLastEmotePlayed;
436 ::ll::TypedStorage<8, 8, int64> mEmoteEasterEggEndTime;
437 ::ll::TypedStorage<4, 4, uint> mEmoteMessageCount;
438 ::ll::TypedStorage<8, 32, ::std::string> mDeviceId;
439 ::ll::TypedStorage<1, 1, bool> mFlagClientForBAIReset;
440 ::ll::TypedStorage<1, 1, uchar> mSendPlayerOptionsFlags;
441 ::ll::TypedStorage<1, 1, bool> mIsHostingPlayer;
442 ::ll::TypedStorage<1, 1, bool> mPrevBlockedUsingShield;
443 ::ll::TypedStorage<1, 1, bool> mPrevBlockedUsingDamagedShield;
444 ::ll::TypedStorage<1, 1, bool> mUsedPotion;
445 ::ll::TypedStorage<8, 8, ::PlayerDestroyProgressCacheComponent&> mDestroyProgressCache;
446 // NOLINTEND
447
448public:
449 // prevent constructor by default
450 Player& operator=(Player const&);
451 Player(Player const&);
452 Player();
453
454public:
455 // virtual functions
456 // NOLINTBEGIN
457 virtual ~Player() /*override*/;
458
459 virtual void
460 initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params) /*override*/;
461
462 virtual void reloadHardcoded(::ActorInitializationMethod method, ::VariantParameterList const& params) /*override*/;
463
464 virtual void prepareRegion(::ChunkSource& mainChunkSource);
465
466 virtual void destroyRegion();
467
468 virtual void suspendRegion();
469
470 virtual void _fireDimensionChanged();
471
472 virtual bool canChangeDimensionsUsingPortal() const /*override*/;
473
474 virtual void changeDimensionWithCredits(::DimensionType dimension);
475
476#ifdef LL_PLAT_S
477 virtual void tickWorld(::Tick const&);
478#else // LL_PLAT_C
479 virtual void tickWorld(::Tick const& currentTick);
480#endif
481
482 virtual void frameUpdate(::FrameUpdateContextBase& frameUpdateContextBase) = 0;
483
484 virtual ::std::vector<::ChunkPos> const& getTickingOffsets() const;
485
486 virtual void normalTick() /*override*/;
487
488 virtual void moveView();
489
490 virtual void moveSpawnView(::Vec3 const& spawnPosition, ::DimensionType dimensionType);
491
492 virtual void onSynchedDataUpdate(int dataId) /*override*/;
493
494 virtual void aiStep() /*override*/;
495
496 virtual bool isFireImmune() const /*override*/;
497
498 virtual void checkMovementStats(::Vec3 const& d);
499
500 virtual ::HashedString getCurrentStructureFeature() const;
501
502 virtual bool isAutoJumpEnabled() const;
503
504 virtual ::Vec3 getInterpolatedRidingOffset(float, int const) const /*override*/;
505
506 virtual void passengerTick() /*override*/;
507
508 virtual void die(::ActorDamageSource const& source) /*override*/;
509
510 virtual void remove() /*override*/;
511
512 virtual void respawn();
513
514 virtual bool shouldDropDeathLoot() const /*override*/;
515
516 virtual void dropEquipmentOnDeath(::ActorDamageSource const& source) /*override*/;
517
518 virtual void dropEquipmentOnDeath() /*override*/;
519
520 virtual void clearVanishEnchantedItemsOnDeath() /*override*/;
521
522 virtual bool drop(::ItemStack const& item, bool const randomly) /*override*/;
523
524 virtual void resetRot();
525
526 virtual void resetUserPos(::ActorResetRule resetRule) /*override*/;
527
528 virtual bool isInTrialMode();
529
530 virtual void setSpeed(float _speed) /*override*/;
531
532 virtual int getItemUseDuration() const /*override*/;
533
534 virtual float getItemUseStartupProgress() const /*override*/;
535
536 virtual float getItemUseIntervalProgress() const /*override*/;
537
538 virtual bool isBlocking() const /*override*/;
539
540 virtual bool isDamageBlocked(::ActorDamageSource const& source) const /*override*/;
541
542 virtual void handleEntityEvent(::ActorEvent id, int data) /*override*/;
543
544 virtual ::std::vector<::ItemStack const*> getAllHandEquipment() const /*override*/;
545
546 virtual ::std::vector<::ItemStack const*> getAllEquipment() const /*override*/;
547
548 virtual bool add(::ItemStack& item) /*override*/;
549
550 virtual ::CommandPermissionLevel getCommandPermissionLevel() const /*override*/;
551
552 virtual ::ActorHurtResult attack(::Actor& actor, ::SharedTypes::Legacy::ActorDamageCause const& cause) /*override*/;
553
554 virtual ::ItemStack const& getCarriedItem() const /*override*/;
555
556 virtual void setCarriedItem(::ItemStack const& item) /*override*/;
557
558 virtual void damageCarriedItemOnAttack(::Actor& target, float damageDealtToTarget) /*override*/;
559
560 virtual void openPortfolio();
561
562#ifdef LL_PLAT_S
563 virtual void openBook(int, bool, int, ::BlockActor*);
564#else // LL_PLAT_C
565 virtual void openBook(int bookSlot, bool editable, int page, ::BlockActor* lectern);
566#endif
567
568 virtual void openTrading(::ActorUniqueID const& uniqueID, bool useNewScreen);
569
570#ifdef LL_PLAT_S
571 virtual void openChalkboard(::ChalkboardBlockActor&, bool);
572#else // LL_PLAT_C
573 virtual void openChalkboard(::ChalkboardBlockActor& chalkboard, bool showLockToggle);
574#endif
575
576 virtual void openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc);
577
578 virtual void openInventory();
579
580 virtual void displayChatMessage(
581 ::std::string const& author,
582 ::std::string const& message,
583 ::std::optional<::std::string> const filteredMessage
584 );
585
586 virtual void
587 displayClientMessage(::std::string const& message, ::std::optional<::std::string> const filteredMessage);
588
589 virtual void displayTextObjectMessage(
590 ::TextObjectRoot const& textObject,
591 ::std::string const& fromXuid,
592 ::std::string const& fromPlatformId
593 );
594
595 virtual void displayTextObjectWhisperMessage(
596 ::ResolvedTextObject const& resolvedTextObject,
597 ::std::string const& xuid,
598 ::std::string const& platformId
599 );
600
601 virtual void displayTextObjectWhisperMessage(
602 ::std::string const& message,
603 ::std::string const& xuid,
604 ::std::string const& platformId
605 );
606
607 virtual void displayWhisperMessage(
608 ::std::string const& author,
609 ::std::string const& message,
610 ::std::optional<::std::string> const filteredMessage,
611 ::std::string const& xuid,
612 ::std::string const& platformId
613 );
614
615 virtual float getShadowRadius() const /*override*/;
616
617 virtual bool isSleeping() const /*override*/;
618
619 virtual void setSleeping(bool val) /*override*/;
620
621 virtual ::BedSleepingResult startSleepInBed(::BlockPos const& bedPos, bool setsRespawn, float sleepOffset);
622
623 virtual void stopSleepInBed(bool forcefulWakeUp, bool updateLevelList);
624
625 virtual bool canStartSleepInBed();
626
627 virtual void sendInventory(bool shouldSelectSlot) /*override*/;
628
629 virtual void openSign(::BlockPos const& position, bool isFrontSide);
630
631#ifdef LL_PLAT_S
632 virtual void playEmote(::std::string const&, bool const);
633#else // LL_PLAT_C
634 virtual void playEmote(::std::string const& pieceId, bool const playChatMessage);
635#endif
636
637 virtual bool isSilentObserver() const /*override*/;
638
639 virtual void useItem(::ItemStackBase& instance, ::ItemUseMethod itemUseMethod, bool consumeItem) /*override*/;
640
641 virtual bool isLoading() const;
642
643 virtual bool isPlayerInitialized() const;
644
645 virtual void stopLoading();
646
647 virtual float getSpeed() const /*override*/;
648
649 virtual void setPlayerGameType(::GameType gameType);
650
651 virtual void initHUDContainerManager();
652
653 virtual void emitCriticalHitParticles(::Actor const& target, int particleCount);
654
655 virtual bool isImmobile() const /*override*/;
656
657 virtual void sendMotionPacketIfNeeded() /*override*/;
658
659 virtual ::IMinecraftEventing* getEventing() const;
660
661 virtual uint getUserId() const;
662
663 virtual void addExperience(int xp);
664
665 virtual void addLevels(int levels);
666
667 virtual void setArmor(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) /*override*/;
668
669 virtual void setOffhandSlot(::ItemStack const& item) /*override*/;
670
671 virtual ::std::unique_ptr<::Packet> tryCreateAddActorPacket() /*override*/;
672
673 virtual bool isInvulnerableTo(::ActorDamageSource const& source) const /*override*/;
674
675 virtual void setContainerData(::IContainerManager& menu, int id, int value) = 0;
676
677 virtual void slotChanged(
678 ::IContainerManager& menu,
679 ::Container& container,
680 int slot,
681 ::ItemStack const& oldItem,
682 ::ItemStack const& newItem,
683 bool isResultSlot
684 ) = 0;
685
686 virtual void refreshContainer(::IContainerManager& menu) = 0;
687
688 virtual void deleteContainerManager();
689
690 virtual ::ItemStack const& getEquippedTotem() const /*override*/;
691
692 virtual bool consumeTotem() /*override*/;
693
694 virtual bool isActorRelevant(::Actor const& actor);
695
696 virtual float getMapDecorationRotation() const /*override*/;
697
698 virtual void teleportTo(
699 ::Vec3 const& pos,
700 bool shouldStopRiding,
701 int cause,
702 int sourceEntityType,
703 bool keepVelocity
704 ) /*override*/;
705
706 virtual bool startRiding(::Actor& vehicle, bool forceRiding) /*override*/;
707
708 virtual void startSwimming() /*override*/;
709
710 virtual void stopSwimming() /*override*/;
711
712 virtual bool isTeacher() const = 0;
713
714 virtual bool isExternalCommunicationAllowed() const = 0;
715
716 virtual void onSuspension();
717
718 virtual void onLinkedSlotsChanged();
719
720 virtual bool canBePulledIntoVehicle() const /*override*/;
721
722 virtual void feed(int itemId) /*override*/;
723
724 virtual void sendInventoryTransaction(::InventoryTransaction const& transaction) const = 0;
725
726 virtual void
727 sendComplexInventoryTransaction(::std::unique_ptr<::ComplexInventoryTransaction> transaction) const = 0;
728
729 virtual void sendNetworkPacket(::Packet& packet) const;
730
731 virtual bool canExistWhenDisallowMob() const /*override*/;
732
733 virtual ::mce::Color getNameTagTextColor() const /*override*/;
734
735 virtual bool canAddPassenger(::Actor& passenger) const /*override*/;
736
737 virtual ::PlayerEventCoordinator& getPlayerEventCoordinator() = 0;
738
739 virtual bool isSimulated() const;
740
741 virtual ::std::string getXuid() const;
742
743 virtual ::PlayerMovementSettings const& getMovementSettings() const;
744
745 virtual bool canInteractWithOtherEntitiesInGame() const /*override*/;
746
747 virtual bool canObstructSpawningAndBlockPlacement() const /*override*/;
748
749 virtual ::std::optional<::BlockPos> getLastDeathPos() const /*override*/;
750
751 virtual ::std::optional<::DimensionType> getLastDeathDimension() const /*override*/;
752
753 virtual bool hasDiedBefore() const /*override*/;
754
755 virtual void doEnterWaterSplashEffect() /*override*/;
756
757 virtual void doExitWaterSplashEffect() /*override*/;
758
759 virtual ::std::optional<::PlayerPartyInfo> getPartyInfo_UNTRUSTED() const;
760
761#ifdef LL_PLAT_S
762 virtual void requestMissingSubChunk(::SubChunkPos const&);
763#else // LL_PLAT_C
764 virtual void requestMissingSubChunk(::SubChunkPos const& scp);
765#endif
766
767 virtual uchar getMaxChunkBuildRadius() const;
768
769 virtual float causeFallDamageToActor(float distance, float multiplier, ::ActorDamageSource source) /*override*/;
770
771#ifdef LL_PLAT_S
772 virtual void setBehaviorCommandStatus(::std::string const&, ::BehaviorStatus);
773#else // LL_PLAT_C
774 virtual void setBehaviorCommandStatus(::std::string const& name, ::BehaviorStatus status);
775#endif
776
777#ifdef LL_PLAT_S
778 virtual void setRemotePlayerTicked(bool);
779#else // LL_PLAT_C
780 virtual void setRemotePlayerTicked(bool ticked);
781#endif
782
783 virtual ::std::unique_ptr<::ISparseContainerSetListener> createSparseContainerListener();
784
785 virtual void addChunksToQueue(::std::vector<::ChunkPos> const& chunkPostions);
786
787 virtual ::ActorHurtResult
788 _hurt(::ActorDamageSource const& source, float damage, ::HurtParameters const& hurtParameters) /*override*/;
789
790 virtual void readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper) /*override*/;
791
792 virtual void addAdditionalSaveData(::CompoundTag& entityTag) const /*override*/;
793
794 virtual void onMovePlayerPacketNormal(::Vec3 const& pos, ::Vec2 const& rot, float yHeadRot);
795
796 virtual bool _shouldProvideFeedbackOnHandContainerItemSet(::HandSlot handSlot, ::ItemStack const& item) const
797 /*override*/;
798
799 virtual bool _shouldProvideFeedbackOnArmorSet(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) const
800 /*override*/;
801
802 virtual ::std::shared_ptr<::ChunkViewSource> _createChunkSource(::ChunkSource& mainChunkSource);
803
804 virtual void setAbilities(::LayeredAbilities const& newAbilities);
805
806 virtual ::AnimationComponent& getAnimationComponent() /*override*/;
807
808 virtual ::HashedString const& getActorRendererId() const /*override*/;
809
810 virtual ::Bedrock::NonOwnerPointer<::Editor::IEditorPlayer> getEditorPlayer() const = 0;
811
812 virtual void destroyEditorPlayer() = 0;
813
814 virtual void _serverInitItemStackIds() /*override*/;
815
816 virtual ::std::unique_ptr<::BodyControl> initBodyControl() /*override*/;
817 // NOLINTEND
818
819public:
820 // member functions
821 // NOLINTBEGIN
822 MCAPI Player(
823 ::ILevel& level,
824 ::PacketSender& packetSender,
825 ::GameType playerGameType,
826 bool isHostingPlayer,
827 ::NetworkIdentifier const& owner,
828 ::SubClientId subid,
829 ::mce::UUID uuid,
830 ::std::string const& deviceId,
831 ::PlayerAuthenticationType authType,
832 ::PlayerAuthenticationInfo const& authInfo,
833 ::EntityContext& entityContext,
834 ::std::string const& platformId,
835 ::std::string const& platformOnlineId
836 );
837
838#ifdef LL_PLAT_C
839 MCAPI bool _canChangeGameType(::GameType newGameType) const;
840#endif
841
842 MCAPI bool _checkAndFixSpawnPosition(
843 ::Vec3& spawnPosition,
844 ::std::vector<::gsl::not_null<::BlockSource*>> regions,
845 bool adjustYToSolidGround,
846 bool searchUp,
847 bool positionFromSave
848 );
849
850#ifdef LL_PLAT_C
851 MCAPI void _enterBedSleepState(::BlockPos const& bedBlockPos, float sleepOffset);
852
853 MCAPI bool _findFallbackSpawnPosition(
854 ::Vec3& spawnPosition,
855 ::std::vector<::gsl::not_null<::BlockSource*>> regions,
856 uint const maxDistance,
857 bool const checkStoredFallback
858 );
859#endif
860
861 MCAPI void _handleCarriedItemInteractText();
862
863 MCAPI bool _isChunkSourceLoaded(::Vec3 const& spawnPosition, ::BlockSource const& region) const;
864
865 MCAPI void _setPlayerGameType(::GameType gameType);
866
867#ifdef LL_PLAT_C
868 MCAPI ::BedSleepingResult _validateCanSleepInBed(::BlockPos const& bedBlockPos) const;
869
870 MCAPI ::BedSleepingResult _validateSleepConditions(::BlockPos const& bedBlockPos) const;
871#endif
872
873 MCAPI bool _validateSpawnPositionAvailability(
874 ::Vec3 const& pos,
875 ::BlockSource* blockSourceChunkCheck,
876 ::Vec3 const* const AABBoffset
877 ) const;
878
879 MCAPI ::ActorHurtResult attack(
880 ::Actor& actor,
881 ::SharedTypes::Legacy::ActorDamageCause const& cause,
882 ::Player::AttackParameters const& parameters
883 );
884
885 MCAPI bool canJump();
886
887 MCAPI bool canOpenContainerScreen();
888
889 MCAPI bool canStackInOffhand(::ItemStack const& item) const;
890
891 MCAPI bool canUseAbility(::AbilitiesIndex abilityIndex) const;
892
893 MCAPI bool canUseOperatorBlocks() const;
894
895 MCAPI void causeFoodExhaustion(float exhaustionAmount);
896
897 MCAPI bool checkBed(::BlockSource* spawnBlockSource, ::Vec3 const* const positionToCheck);
898
899 MCAPI bool checkNeedAutoJump(float inputMoveX, float inputMoveZ);
900
901 MCAPI bool checkSpawnBlock(::BlockSource const& region) const;
902
903 MCAPI void completeUsingItem();
904
905#ifdef LL_PLAT_C
906 MCAPI void crackBlock(::BlockPos const& pos, uchar face);
907#endif
908
909 MCAPI void eat(::ItemStack const& instance);
910
911 MCAPI void eat(int hungerValue, float saturationModifier);
912
913 MCAPI bool equippedArmorItemCanBeMoved(::ItemStack const& item) const;
914
915 MCAPI void fireDimensionChangedEvent(::DimensionType fromDimension, ::DimensionType toDimension);
916
917 MCFOLD ::LayeredAbilities const& getAbilities() const;
918
919 MCFOLD ::LayeredAbilities& getAbilities();
920
921 MCAPI ::Agent* getAgentIfAllowed(bool callerCanAccessOtherAgents, ::ActorUniqueID callerAgentID) const;
922
923 MCAPI ::SoundEventIdentifier getAttackHitSound() const;
924
925 MCAPI ::SoundEventIdentifier getAttackMissSound() const;
926
927 MCAPI ::std::string getChatDisplayName() const;
928
929 MCAPI ::ItemStack const& getCurrentActiveShield() const;
930
931 MCAPI float getDestroyProgress(::Block const& block);
932
933 MCAPI ::DimensionType getExpectedSpawnDimensionId() const;
934
935 MCAPI ::BlockPos const& getExpectedSpawnPosition() const;
936
937 MCAPI ::std::string getInteractText() const;
938
939 MCAPI int getItemCooldownLeft(::HashedString const& category) const;
940
941 MCAPI int getItemCooldownLeft(uint64 categoryHash) const;
942
943#ifdef LL_PLAT_C
944 MCAPI float getItemCooldownProgress(::HashedString const& category) const;
945#endif
946
947 MCAPI ::std::string getItemInteractText(::Item const& item) const;
948
949 MCAPI int getMaxItemCooldownLeft() const;
950
951 MCAPI ::AABB getPickupArea() const;
952
953 MCAPI ::GameType getPlayerGameType() const;
954
955 MCAPI ::PlayerPermissionLevel getPlayerPermissionLevel() const;
956
957 MCAPI float getSleepRotation() const;
958
959#ifdef LL_PLAT_C
960 MCAPI void handleMovePlayerPacket(
961 ::PlayerPositionModeComponent::PositionMode mode,
962 ::Vec3 const& pos,
963 ::Vec2 const& rot,
964 float yHeadRot,
965 int cause,
966 int sourceEntityType
967 );
968#endif
969
970 MCAPI bool hasResource(::ItemDescriptor const& resource);
971
972 MCAPI ::InteractionResult interact(::Actor& actor, ::Vec3 const& location);
973
974 MCAPI void inventoryChanged(
976 int slot,
977 ::ItemStack const& oldItem,
978 ::ItemStack const& newItem,
979 bool forceBalanced
980 );
981
982 MCAPI bool isEditorPlayer() const;
983
984 MCAPI bool isEquipmentHidden() const;
985
986 MCAPI bool isFlying() const;
987
988 MCAPI bool isForcedRespawn() const;
989
990 MCAPI bool isItemOnCooldown(::HashedString const& category) const;
991
992#ifdef LL_PLAT_C
993 MCAPI bool isScoping() const;
994#endif
995
996 MCAPI void playPredictiveSynchronizedSound(
997 ::SoundEventIdentifier const& soundEvent,
998 ::Vec3 const& pos,
999 int data,
1000 bool isGlobal
1001 );
1002
1003 MCAPI void playPredictiveSynchronizedSound(
1004 ::SharedTypes::Legacy::LevelSoundEvent type,
1005 ::Vec3 const& pos,
1006 int data,
1007 bool isGlobal
1008 );
1009
1010#ifdef LL_PLAT_C
1011 MCAPI void registerTrackedBoss(::ActorUniqueID mob);
1012#endif
1013
1014 MCAPI void releaseUsingItem();
1015
1016 MCAPI void resetPlayerLevel();
1017
1018 MCAPI void sendEventPacket(::LegacyTelemetryEventPacket& packet) const;
1019
1020 MCAPI void setAgent(::Agent* agent);
1021
1022#ifdef LL_PLAT_C
1023 MCAPI void setBedRespawnPosition(::BlockPos const& bedPosition);
1024#endif
1025
1026 MCAPI void setChunkRadius(uint chunkRadius);
1027
1028 MCAPI void setCommandPermissions(::CommandPermissionLevel permissions);
1029
1030 MCAPI void setContainerManagerModel(::std::shared_ptr<::ContainerManagerModel> manager);
1031
1032 MCAPI void setName(::std::string const& newName);
1033
1034 MCAPI void setPlayerUIItem(::PlayerUISlot slot, ::ItemStack const& item, bool forceBalance);
1035
1036 MCAPI void setRespawnPosition(::BlockPos const& inRespawnPosition, ::DimensionType dimension);
1037
1038 MCAPI void setRespawnPositionCandidate();
1039
1040 MCAPI ::ItemStack const& setSelectedSlot(int slot);
1041
1042 MCAPI bool setSpawnBlockRespawnPosition(::BlockPos const& spawnBlockPosition, ::DimensionType dimension);
1043
1044 MCAPI void startGliding();
1045
1046 MCAPI void startItemCooldown(::Item const& item, bool updateClient);
1047
1048 MCAPI void startItemCooldown(::HashedString const& type, int tickDuration, bool updateClient);
1049
1050 MCAPI void
1051 startItemUseOn(uchar face, ::BlockPos const& blockPos, ::BlockPos const& buildBlockPos, ::ItemStack const& item);
1052
1053 MCAPI void startUsingItem(::ItemStack const& instance, int duration);
1054
1055 MCAPI void stopGliding();
1056
1057 MCAPI void stopItemUseOn(::BlockPos const& blockPos, ::ItemStack const& item);
1058
1059 MCAPI void stopUsingItem();
1060
1061 MCAPI bool take(::Actor& actor, int, int favoredSlot);
1062
1063 MCAPI bool tryStartGliding();
1064
1065#ifdef LL_PLAT_C
1066 MCAPI void unRegisterTrackedBoss(::ActorUniqueID mob);
1067
1068 MCAPI void updateCreativeItemList(::CreativeItemRegistry const& creativeItemRegistry);
1069
1070 MCAPI bool updateEmoteMessageData(::PersonaPiece const& emotePiece);
1071#endif
1072
1073 MCAPI void updateInventoryTransactions();
1074
1075 MCAPI void updateSkin(::SerializedSkinRef const& skin, int clientSubID);
1076
1077 MCAPI void updateTouch();
1078
1079 MCAPI void useSelectedItem(::ItemUseMethod itemUseMethod, bool consumeItem);
1080 // NOLINTEND
1081
1082public:
1083 // static functions
1084 // NOLINTBEGIN
1085 MCAPI static bool checkNeedAutoJump(
1086 ::IConstBlockSource const& region,
1087 ::AABBShapeComponent const& aabbShape,
1088 ::ActorRotationComponent const& actorRotation,
1089 float movementSpeed,
1090 ::StateVectorComponent const& stateVector,
1092 float inputMoveX,
1093 float inputMoveZ
1094 );
1095
1096 MCAPI static ::std::optional<::SharedTypes::Legacy::LevelSoundEvent>
1097 getCustomHurtSound(::Mob const& mob, ::SharedTypes::Legacy::ActorDamageCause cause);
1098
1099#ifdef LL_PLAT_C
1100 MCAPI static void
1101 updatePlayerGameTypeEntityData(::EntityContext& entity, ::GameType gameType, ::GameType defaultGameType);
1102#endif
1103 // NOLINTEND
1104
1105public:
1106 // static variables
1107 // NOLINTBEGIN
1108 MCAPI static ::Attribute const& EXHAUSTION();
1109
1110 MCAPI static ::Attribute const& EXPERIENCE();
1111
1112 MCAPI static ::Attribute const& HUNGER();
1113
1114 MCAPI static ::Attribute const& LEVEL();
1115
1116 MCAPI static ::Attribute const& SATURATION();
1117 // NOLINTEND
1118
1119public:
1120 // constructor thunks
1121 // NOLINTBEGIN
1122 MCAPI void* $ctor(
1123 ::ILevel& level,
1124 ::PacketSender& packetSender,
1125 ::GameType playerGameType,
1126 bool isHostingPlayer,
1127 ::NetworkIdentifier const& owner,
1128 ::SubClientId subid,
1129 ::mce::UUID uuid,
1130 ::std::string const& deviceId,
1131 ::PlayerAuthenticationType authType,
1132 ::PlayerAuthenticationInfo const& authInfo,
1133 ::EntityContext& entityContext,
1134 ::std::string const& platformId,
1135 ::std::string const& platformOnlineId
1136 );
1137 // NOLINTEND
1138
1139public:
1140 // destructor thunk
1141 // NOLINTBEGIN
1142 MCAPI void $dtor();
1143 // NOLINTEND
1144
1145public:
1146 // virtual function thunks
1147 // NOLINTBEGIN
1148 MCAPI void $initializeComponents(::ActorInitializationMethod method, ::VariantParameterList const& params);
1149
1150 MCAPI void $reloadHardcoded(::ActorInitializationMethod method, ::VariantParameterList const& params);
1151
1152 MCAPI void $prepareRegion(::ChunkSource& mainChunkSource);
1153
1154 MCAPI void $destroyRegion();
1155
1156 MCAPI void $suspendRegion();
1157
1158 MCAPI void $_fireDimensionChanged();
1159
1160 MCAPI bool $canChangeDimensionsUsingPortal() const;
1161
1162 MCFOLD void $changeDimensionWithCredits(::DimensionType dimension);
1163
1164#ifdef LL_PLAT_S
1165 MCAPI void $tickWorld(::Tick const&);
1166#else // LL_PLAT_C
1167 MCAPI void $tickWorld(::Tick const& currentTick);
1168#endif
1169
1170 MCAPI ::std::vector<::ChunkPos> const& $getTickingOffsets() const;
1171
1172 MCAPI void $normalTick();
1173
1174 MCAPI void $moveView();
1175
1176 MCAPI void $moveSpawnView(::Vec3 const& spawnPosition, ::DimensionType dimensionType);
1177
1178 MCFOLD void $onSynchedDataUpdate(int dataId);
1179
1180 MCAPI void $aiStep();
1181
1182 MCAPI bool $isFireImmune() const;
1183
1184 MCFOLD void $checkMovementStats(::Vec3 const& d);
1185
1186 MCAPI ::HashedString $getCurrentStructureFeature() const;
1187
1188 MCFOLD bool $isAutoJumpEnabled() const;
1189
1190 MCAPI ::Vec3 $getInterpolatedRidingOffset(float, int const) const;
1191
1192 MCAPI void $passengerTick();
1193
1194 MCAPI void $die(::ActorDamageSource const& source);
1195
1196 MCAPI void $remove();
1197
1198 MCAPI void $respawn();
1199
1200 MCAPI bool $shouldDropDeathLoot() const;
1201
1202 MCAPI void $dropEquipmentOnDeath(::ActorDamageSource const& source);
1203
1204 MCAPI void $dropEquipmentOnDeath();
1205
1206 MCFOLD void $clearVanishEnchantedItemsOnDeath();
1207
1208 MCAPI bool $drop(::ItemStack const& item, bool const randomly);
1209
1210 MCFOLD void $resetRot();
1211
1212 MCAPI void $resetUserPos(::ActorResetRule resetRule);
1213
1214 MCFOLD bool $isInTrialMode();
1215
1216 MCAPI void $setSpeed(float _speed);
1217
1218 MCAPI int $getItemUseDuration() const;
1219
1220 MCAPI float $getItemUseStartupProgress() const;
1221
1222 MCAPI float $getItemUseIntervalProgress() const;
1223
1224 MCAPI bool $isBlocking() const;
1225
1226 MCAPI bool $isDamageBlocked(::ActorDamageSource const& source) const;
1227
1228 MCAPI void $handleEntityEvent(::ActorEvent id, int data);
1229
1230 MCAPI ::std::vector<::ItemStack const*> $getAllHandEquipment() const;
1231
1232 MCAPI ::std::vector<::ItemStack const*> $getAllEquipment() const;
1233
1234 MCAPI bool $add(::ItemStack& item);
1235
1236 MCAPI ::CommandPermissionLevel $getCommandPermissionLevel() const;
1237
1238 MCAPI ::ActorHurtResult $attack(::Actor& actor, ::SharedTypes::Legacy::ActorDamageCause const& cause);
1239
1240 MCAPI ::ItemStack const& $getCarriedItem() const;
1241
1242 MCAPI void $setCarriedItem(::ItemStack const& item);
1243
1244 MCAPI void $damageCarriedItemOnAttack(::Actor& target, float damageDealtToTarget);
1245
1246 MCFOLD void $openPortfolio();
1247
1248#ifdef LL_PLAT_S
1249 MCFOLD void $openBook(int, bool, int, ::BlockActor*);
1250#else // LL_PLAT_C
1251 MCFOLD void $openBook(int bookSlot, bool editable, int page, ::BlockActor* lectern);
1252#endif
1253
1254 MCFOLD void $openTrading(::ActorUniqueID const& uniqueID, bool useNewScreen);
1255
1256#ifdef LL_PLAT_S
1257 MCFOLD void $openChalkboard(::ChalkboardBlockActor&, bool);
1258#else // LL_PLAT_C
1259 MCFOLD void $openChalkboard(::ChalkboardBlockActor& chalkboard, bool showLockToggle);
1260#endif
1261
1262 MCFOLD void $openNpcInteractScreen(::std::shared_ptr<::INpcDialogueData> npc);
1263
1264 MCFOLD void $openInventory();
1265
1266#ifdef LL_PLAT_S
1267 MCAPI void $displayChatMessage(
1268 ::std::string const& author,
1269 ::std::string const& message,
1270 ::std::optional<::std::string> const filteredMessage
1271 );
1272#else // LL_PLAT_C
1273 MCFOLD void $displayChatMessage(
1274 ::std::string const& author,
1275 ::std::string const& message,
1276 ::std::optional<::std::string> const filteredMessage
1277 );
1278#endif
1279
1280 MCAPI void
1281 $displayClientMessage(::std::string const& message, ::std::optional<::std::string> const filteredMessage);
1282
1283 MCFOLD void $displayTextObjectMessage(
1284 ::TextObjectRoot const& textObject,
1285 ::std::string const& fromXuid,
1286 ::std::string const& fromPlatformId
1287 );
1288
1289 MCFOLD void $displayTextObjectWhisperMessage(
1290 ::ResolvedTextObject const& resolvedTextObject,
1291 ::std::string const& xuid,
1292 ::std::string const& platformId
1293 );
1294
1295 MCFOLD void $displayTextObjectWhisperMessage(
1296 ::std::string const& message,
1297 ::std::string const& xuid,
1298 ::std::string const& platformId
1299 );
1300
1301 MCFOLD void $displayWhisperMessage(
1302 ::std::string const& author,
1303 ::std::string const& message,
1304 ::std::optional<::std::string> const filteredMessage,
1305 ::std::string const& xuid,
1306 ::std::string const& platformId
1307 );
1308
1309 MCAPI float $getShadowRadius() const;
1310
1311 MCAPI bool $isSleeping() const;
1312
1313 MCAPI void $setSleeping(bool val);
1314
1315 MCAPI ::BedSleepingResult $startSleepInBed(::BlockPos const& bedPos, bool setsRespawn, float sleepOffset);
1316
1317 MCAPI void $stopSleepInBed(bool forcefulWakeUp, bool updateLevelList);
1318
1319 MCAPI bool $canStartSleepInBed();
1320
1321 MCFOLD void $sendInventory(bool shouldSelectSlot);
1322
1323 MCFOLD void $openSign(::BlockPos const& position, bool isFrontSide);
1324
1325#ifdef LL_PLAT_S
1326 MCFOLD void $playEmote(::std::string const&, bool const);
1327#else // LL_PLAT_C
1328 MCFOLD void $playEmote(::std::string const& pieceId, bool const playChatMessage);
1329#endif
1330
1331 MCAPI bool $isSilentObserver() const;
1332
1333 MCAPI void $useItem(::ItemStackBase& instance, ::ItemUseMethod itemUseMethod, bool consumeItem);
1334
1335 MCFOLD bool $isLoading() const;
1336
1337 MCFOLD bool $isPlayerInitialized() const;
1338
1339 MCFOLD void $stopLoading();
1340
1341 MCAPI float $getSpeed() const;
1342
1343 MCAPI void $setPlayerGameType(::GameType gameType);
1344
1345 MCAPI void $initHUDContainerManager();
1346
1347 MCAPI void $emitCriticalHitParticles(::Actor const& target, int particleCount);
1348
1349 MCAPI bool $isImmobile() const;
1350
1351 MCFOLD void $sendMotionPacketIfNeeded();
1352
1353 MCAPI ::IMinecraftEventing* $getEventing() const;
1354
1355 MCFOLD uint $getUserId() const;
1356
1357 MCAPI void $addExperience(int xp);
1358
1359 MCAPI void $addLevels(int levels);
1360
1361 MCAPI void $setArmor(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item);
1362
1363 MCAPI void $setOffhandSlot(::ItemStack const& item);
1364
1365 MCAPI ::std::unique_ptr<::Packet> $tryCreateAddActorPacket();
1366
1367 MCAPI bool $isInvulnerableTo(::ActorDamageSource const& source) const;
1368
1369 MCAPI void $deleteContainerManager();
1370
1371 MCAPI ::ItemStack const& $getEquippedTotem() const;
1372
1373 MCAPI bool $consumeTotem();
1374
1375 MCFOLD bool $isActorRelevant(::Actor const& actor);
1376
1377 MCFOLD float $getMapDecorationRotation() const;
1378
1379 MCAPI void
1380 $teleportTo(::Vec3 const& pos, bool shouldStopRiding, int cause, int sourceEntityType, bool keepVelocity);
1381
1382 MCAPI bool $startRiding(::Actor& vehicle, bool forceRiding);
1383
1384 MCAPI void $startSwimming();
1385
1386 MCAPI void $stopSwimming();
1387
1388 MCFOLD void $onSuspension();
1389
1390 MCFOLD void $onLinkedSlotsChanged();
1391
1392 MCFOLD bool $canBePulledIntoVehicle() const;
1393
1394 MCAPI void $feed(int itemId);
1395
1396 MCFOLD void $sendNetworkPacket(::Packet& packet) const;
1397
1398 MCFOLD bool $canExistWhenDisallowMob() const;
1399
1400 MCAPI ::mce::Color $getNameTagTextColor() const;
1401
1402 MCAPI bool $canAddPassenger(::Actor& passenger) const;
1403
1404 MCFOLD bool $isSimulated() const;
1405
1406 MCAPI ::std::string $getXuid() const;
1407
1408 MCAPI ::PlayerMovementSettings const& $getMovementSettings() const;
1409
1410 MCAPI bool $canInteractWithOtherEntitiesInGame() const;
1411
1412 MCAPI bool $canObstructSpawningAndBlockPlacement() const;
1413
1414 MCAPI ::std::optional<::BlockPos> $getLastDeathPos() const;
1415
1416 MCAPI ::std::optional<::DimensionType> $getLastDeathDimension() const;
1417
1418 MCAPI bool $hasDiedBefore() const;
1419
1420 MCAPI void $doEnterWaterSplashEffect();
1421
1422 MCAPI void $doExitWaterSplashEffect();
1423
1424 MCFOLD ::std::optional<::PlayerPartyInfo> $getPartyInfo_UNTRUSTED() const;
1425
1426#ifdef LL_PLAT_S
1427 MCFOLD void $requestMissingSubChunk(::SubChunkPos const&);
1428#else // LL_PLAT_C
1429 MCFOLD void $requestMissingSubChunk(::SubChunkPos const& scp);
1430#endif
1431
1432 MCFOLD uchar $getMaxChunkBuildRadius() const;
1433
1434 MCAPI float $causeFallDamageToActor(float distance, float multiplier, ::ActorDamageSource source);
1435
1436#ifdef LL_PLAT_S
1437 MCFOLD void $setBehaviorCommandStatus(::std::string const&, ::BehaviorStatus);
1438#else // LL_PLAT_C
1439 MCFOLD void $setBehaviorCommandStatus(::std::string const& name, ::BehaviorStatus status);
1440#endif
1441
1442#ifdef LL_PLAT_S
1443 MCFOLD void $setRemotePlayerTicked(bool);
1444#else // LL_PLAT_C
1445 MCFOLD void $setRemotePlayerTicked(bool ticked);
1446#endif
1447
1448 MCFOLD ::std::unique_ptr<::ISparseContainerSetListener> $createSparseContainerListener();
1449
1450 MCFOLD void $addChunksToQueue(::std::vector<::ChunkPos> const& chunkPostions);
1451
1452 MCAPI ::ActorHurtResult
1453 $_hurt(::ActorDamageSource const& source, float damage, ::HurtParameters const& hurtParameters);
1454
1455 MCAPI void $readAdditionalSaveData(::CompoundTag const& tag, ::DataLoadHelper& dataLoadHelper);
1456
1457 MCAPI void $addAdditionalSaveData(::CompoundTag& entityTag) const;
1458
1459 MCAPI void $onMovePlayerPacketNormal(::Vec3 const& pos, ::Vec2 const& rot, float yHeadRot);
1460
1461 MCAPI bool $_shouldProvideFeedbackOnHandContainerItemSet(::HandSlot handSlot, ::ItemStack const& item) const;
1462
1463 MCAPI bool $_shouldProvideFeedbackOnArmorSet(::SharedTypes::Legacy::ArmorSlot slot, ::ItemStack const& item) const;
1464
1465 MCAPI ::std::shared_ptr<::ChunkViewSource> $_createChunkSource(::ChunkSource& mainChunkSource);
1466
1467 MCAPI void $setAbilities(::LayeredAbilities const& newAbilities);
1468
1469 MCAPI ::AnimationComponent& $getAnimationComponent();
1470
1471 MCAPI ::HashedString const& $getActorRendererId() const;
1472
1473 MCFOLD void $_serverInitItemStackIds();
1474
1475 MCAPI ::std::unique_ptr<::BodyControl> $initBodyControl();
1476
1477
1478 // NOLINTEND
1479};
Definition AABB.h:18
Definition ActorDamageSource.h:18
Definition ActorHurtResult.h:5
Definition Actor.h:113
Definition Agent.h:34
Definition AnimationComponent.h:38
Definition Attribute.h:9
Definition BlockActor.h:29
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition Block.h:41
Definition BodyControl.h:13
Definition ChalkboardBlockActor.h:25
Definition ChunkPos.h:13
Definition ChunkSource.h:36
Definition ChunkViewSource.h:22
Definition ComplexInventoryTransaction.h:20
Definition CompoundTag.h:18
Definition ConnectionRequest.h:26
Definition ContainerManagerModel.h:32
Definition Container.h:35
Definition CreativeItemRegistry.h:23
Definition DataLoadHelper.h:20
Definition IEditorPlayer.h:17
Definition EnderChestContainer.h:15
Definition EntityContext.h:15
Definition FrameUpdateContextBase.h:5
Definition GameMode.h:26
Definition GetCollisionShapeInterface.h:13
Definition HashedString.h:5
Definition HudContainerManagerModel.h:18
Definition IConstBlockSource.h:25
Definition IContainerManager.h:16
Definition ILevel.h:221
Definition IMinecraftEventing.h:147
Definition ISparseContainerSetListener.h:11
Definition InteractionResult.h:5
Definition InventoryTransaction.h:18
Definition Inventory.h:13
Definition ItemDescriptor.h:25
Definition ItemStackBase.h:44
Definition ItemStackNetManagerBase.h:28
Definition ItemStack.h:26
Definition Item.h:71
Definition LayeredAbilities.h:20
Definition LegacyTelemetryEventPacket.h:19
Definition NetworkChunkPublisher.h:27
Definition NetworkIdentifier.h:10
Definition PacketSender.h:17
Definition Packet.h:29
Definition PersonaPiece.h:18
Definition PlayerEventCoordinator.h:20
Definition PlayerInventory.h:17
Definition PlayerListener.h:5
Definition PlayerRespawnRandomizer.h:10
LLNDAPI std::string getIPAndPort() const
Get the player's IP and port.
LLNDAPI std::string getLocaleCode() const
Get the name of the player's langtext.
LLAPI void sendMessage(std::string_view msg) const
Send a message to player.
LLAPI bool addAndRefresh(class ItemStack &item)
Give player item and refresh.
LLNDAPI mce::UUID const & getUuid() const
Get the player's uuid.
LLNDAPI bool isOperator() const
Determine if a player is an administrator of the server.
LLNDAPI std::string getRealName() const
Get the player's real in-game nickname.
LLAPI void disconnect(std::string_view reason) const
Disconnect player's client.
Definition ResolvedTextObject.h:5
Definition SerializedSkinRef.h:26
Definition SubChunkPos.h:5
Definition TextObjectRoot.h:14
Definition UserEntityIdentifierComponent.h:17
Definition Vec2.h:5
Definition Vec3.h:10
Definition Color.h:13
Definition UUID.h:8
Definition optional_ref.h:10
STL namespace.
Definition AABBShapeComponent.h:9
Definition ActorRotationComponent.h:8
Definition ActorUniqueID.h:5
Definition BiomeIdType.h:8
Definition DimensionType.h:5
Definition HurtParameters.h:8
Definition INpcDialogueData.h:12
Definition PlayerAuthenticationInfo.h:9
Definition PlayerDestroyProgressCacheComponent.h:8
Definition PlayerMovementSettings.h:9
Definition PlayerPartyInfo.h:5
Definition Player.h:160
Definition Player.h:179
Definition Player.h:197
Definition Player.h:215
Definition SoundEventIdentifier.h:13
Definition StateVectorComponent.h:8
Definition Tick.h:5
Definition VariantParameterList.h:14