Botcraft 1.21.11
Loading...
Searching...
No Matches
WolfEntity.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace Botcraft
6{
8 {
9 protected:
10
11#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
12 static constexpr int metadata_count = 5;
13#elif PROTOCOL_VERSION > 765 /* > 1.20.4 */
14 static constexpr int metadata_count = 4;
15#elif PROTOCOL_VERSION > 578 /* > 1.15.2 */
16 static constexpr int metadata_count = 3;
17#elif PROTOCOL_VERSION > 498 /* > 1.14.4 */
18 static constexpr int metadata_count = 2;
19#else
20 static constexpr int metadata_count = 3;
21#endif
22 static const std::array<std::string, metadata_count> metadata_names;
24
25 public:
26 WolfEntity();
27 virtual ~WolfEntity();
28
29 // Object related stuff
30 virtual std::string GetName() const override;
31 virtual EntityType GetType() const override;
32
33 // Static stuff, for easier comparison
34 static std::string GetClassName();
35 static EntityType GetClassType();
36
37
38 virtual ProtocolCraft::Json::Value Serialize() const override;
39
40 // Metadata stuff
41 virtual void SetMetadataValue(const int index, const std::any& value) override;
42
43
44#if PROTOCOL_VERSION < 499 /* < 1.15 */
45 float GetDataHealthId() const;
46#endif
47 bool GetDataInterestedId() const;
48 int GetDataCollarColor() const;
49#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
50#if PROTOCOL_VERSION < 774 /* < 1.21.11 */
51 int GetDataRemainingAngerTime() const;
52#else
53 long long int GetDataAngerEndTime() const;
54#endif
55#endif
56#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
57 int GetDataVariantId() const;
58#endif
59#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
60 int GetDataSoundVariantId() const;
61#endif
62
63#if PROTOCOL_VERSION < 499 /* < 1.15 */
64 void SetDataHealthId(const float data_health_id);
65#endif
66 void SetDataInterestedId(const bool data_interested_id);
67 void SetDataCollarColor(const int data_collar_color);
68#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
69#if PROTOCOL_VERSION < 774 /* < 1.21.11 */
70 void SetDataRemainingAngerTime(const int data_remaining_anger_time);
71#else
72 void SetDataAngerEndTime(const long long int data_anger_end_time);
73#endif
74#endif
75#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
76 void SetDataVariantId(const int data_variant_id);
77#endif
78#if PROTOCOL_VERSION > 769 /* > 1.21.4 */
79 void SetDataSoundVariantId(const int data_sound_variant_id);
80#endif
81
82 // Attribute stuff
83 double GetAttributeAttackDamageValue() const;
84
85 protected:
86 virtual double GetWidthImpl() const override;
87 virtual double GetHeightImpl() const override;
88
89 };
90}
void SetDataHealthId(const float data_health_id)
float GetDataHealthId() const
static constexpr int hierarchy_metadata_count
static std::string GetClassName()
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataVariantId(const int data_variant_id)
static EntityType GetClassType()
virtual std::string GetName() const override
bool GetDataInterestedId() const
int GetDataSoundVariantId() const
int GetDataCollarColor() const
virtual void SetMetadataValue(const int index, const std::any &value) override
static constexpr int hierarchy_metadata_count
void SetDataCollarColor(const int data_collar_color)
int GetDataVariantId() const
virtual double GetHeightImpl() const override
void SetDataAngerEndTime(const long long int data_anger_end_time)
double GetAttributeAttackDamageValue() const
void SetDataInterestedId(const bool data_interested_id)
static const std::array< std::string, metadata_count > metadata_names
static constexpr int metadata_count
long long int GetDataAngerEndTime() const
void SetDataSoundVariantId(const int data_sound_variant_id)
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45