Botcraft 1.21.4
Loading...
Searching...
No Matches
BoatEntity.hpp
Go to the documentation of this file.
1#pragma once
2
3#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
5#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
7#else
9#endif
10
11namespace Botcraft
12{
13#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
14 class BoatEntity : public Entity
15#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
16 class BoatEntity : public VehicleEntity
17#else
19#endif
20 {
21 protected:
22#if PROTOCOL_VERSION < 341 /* < 1.13 */
23 static constexpr int metadata_count = 6;
24#elif PROTOCOL_VERSION < 765 /* < 1.20.3 */
25 static constexpr int metadata_count = 7;
26#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
27 static constexpr int metadata_count = 4;
28#else
29 static constexpr int metadata_count = 0;
30#endif
31#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
32 static const std::array<std::string, metadata_count> metadata_names;
33#endif
34#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
36#elif PROTOCOL_VERSION < 768 /* < 1.21.2 */
38#else
40#endif
41
42 public:
43#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
44 BoatEntity();
45#else
47#endif
48 virtual ~BoatEntity();
49
50 // Object related stuff
51 virtual std::string GetName() const override;
52 virtual EntityType GetType() const override;
53
54 // Static stuff, for easier comparison
55 static std::string GetClassName();
56#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
57 static EntityType GetClassType();
58#else
59 virtual bool IsBoat() const override;
60#endif
61
62
63 virtual ProtocolCraft::Json::Value Serialize() const override;
64
65#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
66 // Metadata stuff
67 virtual void SetMetadataValue(const int index, const std::any& value) override;
68
69#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
70 int GetDataIdHurt() const;
71 int GetDataIdHurtdir() const;
72 float GetDataIdDamage() const;
73#endif
74 int GetDataIdType() const;
75 bool GetDataIdPaddleLeft() const;
76 bool GetDataIdPaddleRight() const;
77#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
78 int GetDataIdBubbleTime() const;
79#endif
80
81#if PROTOCOL_VERSION < 765 /* < 1.20.3 */
82 void SetDataIdHurt(const int data_id_hurt);
83 void SetDataIdHurtdir(const int data_id_hurtdir);
84 void SetDataIdDamage(const float data_id_damage);
85#endif
86 void SetDataIdType(const int data_id_type);
87 void SetDataIdPaddleLeft(const bool data_id_paddle_left);
88 void SetDataIdPaddleRight(const bool data_id_paddle_right);
89#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
90 void SetDataIdBubbleTime(const int data_id_bubble_time);
91#endif
92#endif
93
94#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
95 protected:
97#endif
98
99 protected:
100 virtual double GetWidthImpl() const override;
101 virtual double GetHeightImpl() const override;
102
103 };
104}
virtual void SetMetadataValue(const int index, const std::any &value) override
void SetDataIdPaddleRight(const bool data_id_paddle_right)
static const std::array< std::string, metadata_count > metadata_names
static constexpr int metadata_count
void SetDataIdBubbleTime(const int data_id_bubble_time)
void SetDataIdPaddleLeft(const bool data_id_paddle_left)
static constexpr int hierarchy_metadata_count
virtual double GetWidthImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
virtual EntityType GetType() const override
static std::string GetClassName()
virtual double GetHeightImpl() const override
const EntityType type
virtual bool IsBoat() const override
static constexpr int hierarchy_metadata_count
virtual std::string GetName() const override
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:62
static constexpr int metadata_count
Definition Entity.hpp:55
void SetDataIdHurt(const int data_id_hurt)
static constexpr int metadata_count
void SetDataIdDamage(const float data_id_damage)
float GetDataIdDamage() const
static constexpr int hierarchy_metadata_count
void SetDataIdHurtdir(const int data_id_hurtdir)
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45