Botcraft 26.3
Loading...
Searching...
No Matches
ShulkerEntity.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace Botcraft
6{
8 {
9 private:
10 static constexpr std::array metadata_names{
11 std::string_view("data_attach_face_id"),
12#if PROTOCOL_VERSION < 755 /* < 1.17 */
13 std::string_view("data_attach_pos_id"),
14#endif
15 std::string_view("data_peek_id"),
16 std::string_view("data_color_id"),
17 };
18 protected:
19 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
21
22 public:
24 virtual ~ShulkerEntity();
25
26 // Object related stuff
27 virtual std::string GetName() const override;
28 virtual EntityType GetType() const override;
29
30 // Static stuff, for easier comparison
31 static std::string GetClassName();
32 static EntityType GetClassType();
33
34
35 virtual ProtocolCraft::Json::Value Serialize() const override;
36
37 // Metadata stuff
39#if PROTOCOL_VERSION < 755 /* < 1.17 */
40 std::optional<Position> GetDataAttachPosId() const;
41#endif
42 char GetDataPeekId() const;
43 char GetDataColorId() const;
44
45 void SetDataAttachFaceId(const Direction data_attach_face_id);
46#if PROTOCOL_VERSION < 755 /* < 1.17 */
47 void SetDataAttachPosId(const std::optional<Position>& data_attach_pos_id);
48#endif
49 void SetDataPeekId(const char data_peek_id);
50 void SetDataColorId(const char data_color_id);
51
52 // Attribute stuff
53#if PROTOCOL_VERSION < 767 /* < 1.21 */
54 // 7e0292f2-9434-48d5-a29f-9583af7df27f
55 static constexpr std::array<unsigned char, 16> covered_armor_modifier_key = { 0x7E, 0x2, 0x92, 0xF2, 0x94, 0x34, 0x48, 0xD5, 0xA2, 0x9F, 0x95, 0x83, 0xAF, 0x7D, 0xF2, 0x7F };
56#else
57 inline static const std::string covered_armor_modifier_key = "minecraft:covered";
58#endif
59
60
61 protected:
62 virtual double GetWidthImpl() const override;
63 virtual double GetHeightImpl() const override;
64
65 };
66}
static constexpr int hierarchy_metadata_count
void SetDataPeekId(const char data_peek_id)
virtual std::string GetName() const override
static EntityType GetClassType()
Direction GetDataAttachFaceId() const
virtual double GetHeightImpl() const override
virtual EntityType GetType() const override
static constexpr int metadata_count
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
static constexpr std::array metadata_names
static const std::string covered_armor_modifier_key
virtual double GetWidthImpl() const override
void SetDataAttachFaceId(const Direction data_attach_face_id)
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataColorId(const char data_color_id)
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45