Botcraft 1.21.4
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 protected:
19#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
20 static constexpr int metadata_count = 3;
21#else
22 static constexpr int metadata_count = 2;
23#endif
24 static const std::array<std::string, metadata_count> metadata_names;
25#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
27#else
29#endif
30
31 public:
33 virtual ~FireworkRocketEntity();
34
35 // Object related stuff
36 virtual std::string GetName() const override;
37 virtual EntityType GetType() const override;
38
39 // Static stuff, for easier comparison
40 static std::string GetClassName();
41 static EntityType GetClassType();
42
43
44 virtual ProtocolCraft::Json::Value Serialize() const override;
45
46 // Metadata stuff
47 virtual void SetMetadataValue(const int index, const std::any& value) override;
48
50#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
51 std::optional<int> GetDataAttachedToTarget() const;
52 bool GetDataShotAtAngle() const;
53#else
54 int GetDataAttachedToTarget() const;
55#endif
56
57 void SetDataIdFireworksItem(const ProtocolCraft::Slot& data_id_fireworks_item);
58#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
59 void SetDataAttachedToTarget(const std::optional<int>& data_attached_to_target);
60 void SetDataShotAtAngle(const bool data_shot_at_angle);
61#else
62 void SetDataAttachedToTarget(const int data_attached_to_target);
63#endif
64
65 protected:
66 virtual double GetWidthImpl() const override;
67 virtual double GetHeightImpl() const override;
68
69 };
70}
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:62
static constexpr int metadata_count
Definition Entity.hpp:55
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 void SetMetadataValue(const int index, const std::any &value) override
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 int hierarchy_metadata_count
static const std::array< std::string, metadata_count > metadata_names
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