Botcraft 1.21.4
Loading...
Searching...
No Matches
PlayerEntity.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace Botcraft
7{
9 {
10 protected:
11 static constexpr int metadata_count = 6;
12 static const std::array<std::string, metadata_count> metadata_names;
14
15 public:
17 virtual ~PlayerEntity();
18
19 // Object related stuff
20 /// @brief Get the name of this entity TYPE as a string. For player name see NetworkManager::GetMyName()
21 virtual std::string GetName() const override;
22 virtual EntityType GetType() const override;
23
24#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
25 using Entity::GetCollider; // Required as otherwise GetCollider(Pose) would be found and stop the search for a GetCollider match
26 AABB GetCollider(const Pose pose) const;
27 using Entity::GetHeight; // Required as otherwise GetHeight(Pose) would be found and stop the search for a GetHeight match
28 double GetHeight(const Pose pose) const;
29 using Entity::GetWidth; // Required as otherwise GetWidth(Pose) would be found and stop the search for a GetWidth match
30 double GetWidth(const Pose pose) const;
31#endif
32 double GetEyeHeight() const;
33
34 // Static stuff, for easier comparison
35 static std::string GetClassName();
36 static EntityType GetClassType();
37
38
39 virtual ProtocolCraft::Json::Value Serialize() const override;
40
41 // Metadata stuff
42 virtual void SetMetadataValue(const int index, const std::any& value) override;
43
44 float GetDataPlayerAbsorptionId() const;
45 int GetDataScoreId() const;
47 char GetDataPlayerMainHand() const;
50
51 void SetDataPlayerAbsorptionId(const float data_player_absorption_id);
52 void SetDataScoreId(const int data_score_id);
53 void SetDataPlayerModeCustomisation(const char data_player_mode_customisation);
54 void SetDataPlayerMainHand(const char data_player_main_hand);
55 void SetDataShoulderLeft(const ProtocolCraft::NBT::Value& data_shoulder_left);
56 void SetDataShoulderRight(const ProtocolCraft::NBT::Value& data_shoulder_right);
57
58 virtual bool IsRemotePlayer() const override;
59
60 // Attribute stuff
61 double GetAttributeAttackDamageValue() const;
62 double GetAttributeAttackSpeedValue() const;
63 double GetAttributeLuckValue() const;
64#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
68#endif
69#if PROTOCOL_VERSION > 766 /* > 1.20.6 */
74#endif
75
76 protected:
77 virtual double GetEyeHeightImpl() const;
78 virtual double GetWidthImpl() const override;
79 virtual double GetHeightImpl() const override;
80#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
81 using Entity::GetColliderImpl; // Required as otherwise GetColliderImpl(Pose) would be found and stop the search for a GetColliderImpl match
82 AABB GetColliderImpl(const Pose pose) const;
83#endif
84#if PROTOCOL_VERSION > 766 /* > 1.20.6 */
86#endif
87
88 };
89}
double GetHeight() const
Definition Entity.cpp:331
AABB GetCollider() const
Definition Entity.cpp:319
double GetWidth() const
Definition Entity.cpp:325
AABB GetColliderImpl() const
Definition Entity.cpp:1992
static constexpr int hierarchy_metadata_count
static constexpr int metadata_count
double GetAttributePlayerBlockBreakSpeedValue() const
virtual void SetMetadataValue(const int index, const std::any &value) override
void SetDataPlayerModeCustomisation(const char data_player_mode_customisation)
double GetAttributeAttackSpeedValue() const
void SetDataPlayerAbsorptionId(const float data_player_absorption_id)
double GetHeight() const
Definition Entity.cpp:331
void SetDataShoulderRight(const ProtocolCraft::NBT::Value &data_shoulder_right)
virtual double GetWidthImpl() const override
void SetDataShoulderLeft(const ProtocolCraft::NBT::Value &data_shoulder_left)
double GetAttributePlayerSweepingDamageRatioValue() const
static constexpr int hierarchy_metadata_count
AABB GetCollider() const
Definition Entity.cpp:319
virtual double GetHeightImpl() const override
double GetWidth() const
Definition Entity.cpp:325
float GetDataPlayerAbsorptionId() const
virtual std::string GetName() const override
Get the name of this entity TYPE as a string. For player name see NetworkManager::GetMyName()
virtual EntityType GetType() const override
double GetAttributeLuckValue() const
double GetAttributePlayerSneakingSpeedValueImpl() const
void SetDataPlayerMainHand(const char data_player_main_hand)
char GetDataPlayerModeCustomisation() const
double GetAttributePlayerBlockInteractionRangeValue() const
virtual ProtocolCraft::Json::Value Serialize() const override
virtual bool IsRemotePlayer() const override
double GetAttributePlayerEntityInteractionRangeValue() const
static constexpr int metadata_count
AABB GetColliderImpl() const
Definition Entity.cpp:1992
static EntityType GetClassType()
void SetDataScoreId(const int data_score_id)
double GetAttributePlayerSubmergedMiningSpeedValue() const
static std::string GetClassName()
char GetDataPlayerMainHand() const
ProtocolCraft::NBT::Value GetDataShoulderLeft() const
ProtocolCraft::NBT::Value GetDataShoulderRight() const
double GetEyeHeight() const
virtual double GetEyeHeightImpl() const
double GetAttributePlayerMiningEfficiencyValue() const
static const std::array< std::string, metadata_count > metadata_names
double GetAttributePlayerSneakingSpeedValue() const
double GetAttributeAttackDamageValue() const
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45