Botcraft 1.21.4
Loading...
Searching...
No Matches
AbstractArrowEntity.hpp
Go to the documentation of this file.
1#pragma once
2
3#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
5#else
7#endif
8
9namespace Botcraft
10{
11#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
13#else
14 class AbstractArrowEntity : public Entity
15#endif
16 {
17 protected:
18#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
19 static constexpr int metadata_count = 3;
20#elif PROTOCOL_VERSION > 578 /* > 1.15.2 */
21 static constexpr int metadata_count = 2;
22#elif PROTOCOL_VERSION > 404 /* > 1.13.2 */
23 static constexpr int metadata_count = 3;
24#elif PROTOCOL_VERSION > 393 /* > 1.13 */
25 static constexpr int metadata_count = 2;
26#else
27 static constexpr int metadata_count = 1;
28#endif
29 static const std::array<std::string, metadata_count> metadata_names;
30#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
32#else
34#endif
35
36 public:
38 virtual ~AbstractArrowEntity();
39
40 virtual bool IsAbstractArrow() const override;
41
42 virtual ProtocolCraft::Json::Value Serialize() const override;
43
44 // Metadata stuff
45 virtual void SetMetadataValue(const int index, const std::any& value) override;
46
47 char GetIdFlags() const;
48#if PROTOCOL_VERSION < 579 /* < 1.16 */ && PROTOCOL_VERSION > 393 /* > 1.13 */
49 std::optional<ProtocolCraft::UUID> GetDataOwneruuidId() const;
50#endif
51#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
52 char GetPierceLevel() const;
53#endif
54#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
55 bool GetInGround() const;
56#endif
57
58 void SetIdFlags(const char id_flags);
59#if PROTOCOL_VERSION < 579 /* < 1.16 */ && PROTOCOL_VERSION > 393 /* > 1.13 */
60 void SetDataOwneruuidId(const std::optional<ProtocolCraft::UUID>& data_owneruuid_id);
61#endif
62#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
63 void SetPierceLevel(const char pierce_level);
64#endif
65#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
66 void SetInGround(const bool in_ground);
67#endif
68
69 };
70}
void SetInGround(const bool in_ground)
virtual void SetMetadataValue(const int index, const std::any &value) override
void SetIdFlags(const char id_flags)
virtual bool IsAbstractArrow() const override
static constexpr int hierarchy_metadata_count
static const std::array< std::string, metadata_count > metadata_names
virtual ProtocolCraft::Json::Value Serialize() const override
void SetPierceLevel(const char pierce_level)
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:62
static constexpr int metadata_count
Definition Entity.hpp:55
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