Botcraft 26.3
Loading...
Searching...
No Matches
FireworkRocketEntity.hpp
Go to the documentation of this file.
1#pragma once
2
3#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
5#else
7#endif
9
10namespace Botcraft
11{
12#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
14#else
15 class FireworkRocketEntity : public Entity
16#endif
17 {
18 private:
19 static constexpr std::array metadata_names{
20 std::string_view("data_id_fireworks_item"),
21#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
22 std::string_view("data_attached_to_target"),
23 std::string_view("data_shot_at_angle"),
24#else
25 std::string_view("data_attached_to_target"),
26#endif
27 };
28 protected:
29 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
30#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
32#else
34#endif
35
36 public:
38 virtual ~FireworkRocketEntity();
39
40 // Object related stuff
41 virtual std::string GetName() const override;
42 virtual EntityType GetType() const override;
43
44 // Static stuff, for easier comparison
45 static std::string GetClassName();
46 static EntityType GetClassType();
47
48
49 virtual ProtocolCraft::Json::Value Serialize() const override;
50
51 // Metadata stuff
53#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
54 std::optional<int> GetDataAttachedToTarget() const;
55 bool GetDataShotAtAngle() const;
56#else
57 int GetDataAttachedToTarget() const;
58#endif
59
60 void SetDataIdFireworksItem(const ProtocolCraft::Slot& data_id_fireworks_item);
61#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
62 void SetDataAttachedToTarget(const std::optional<int>& data_attached_to_target);
63 void SetDataShotAtAngle(const bool data_shot_at_angle);
64#else
65 void SetDataAttachedToTarget(const int data_attached_to_target);
66#endif
67
68 protected:
69 virtual double GetWidthImpl() const override;
70 virtual double GetHeightImpl() const override;
71
72 };
73}
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:73
static constexpr int metadata_count
Definition Entity.hpp:72
virtual double GetHeightImpl() const override
ProtocolCraft::Slot GetDataIdFireworksItem() const
virtual ProtocolCraft::Json::Value Serialize() const override
std::optional< int > GetDataAttachedToTarget() const
virtual double GetWidthImpl() const override
void SetDataShotAtAngle(const bool data_shot_at_angle)
virtual std::string GetName() const override
void SetDataIdFireworksItem(const ProtocolCraft::Slot &data_id_fireworks_item)
virtual EntityType GetType() const override
void SetDataAttachedToTarget(const std::optional< int > &data_attached_to_target)
static constexpr std::array metadata_names
static constexpr int hierarchy_metadata_count
static constexpr int hierarchy_metadata_count
static constexpr int metadata_count
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45