Botcraft 26.3
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 private:
18 static constexpr std::array metadata_names{
19 std::string_view("id_flags"),
20#if PROTOCOL_VERSION < 579 /* < 1.16 */ && PROTOCOL_VERSION > 393 /* > 1.13 */
21 std::string_view("data_owneruuid_id"),
22#endif
23#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
24 std::string_view("pierce_level"),
25#endif
26#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
27 std::string_view("in_ground"),
28#endif
29 };
30 protected:
31 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
32#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
34#else
36#endif
37
38 public:
40 virtual ~AbstractArrowEntity();
41
42 virtual bool IsAbstractArrow() const override;
43
44 virtual ProtocolCraft::Json::Value Serialize() const override;
45
46 // Metadata stuff
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)
static constexpr std::array metadata_names
void SetIdFlags(const char id_flags)
virtual bool IsAbstractArrow() const override
static constexpr int hierarchy_metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetPierceLevel(const char pierce_level)
static constexpr int hierarchy_metadata_count
Definition Entity.hpp:73
static constexpr int metadata_count
Definition Entity.hpp:72
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