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