Botcraft 26.3
Loading...
Searching...
No Matches
VillagerEntity.hpp
Go to the documentation of this file.
1#pragma once
2
3#if PROTOCOL_VERSION > 477 /* > 1.14 */
5#else
7#endif
8#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
10#endif
11
12namespace Botcraft
13{
14#if PROTOCOL_VERSION > 477 /* > 1.14 */
16#else
17 class VillagerEntity : public AgeableMobEntity
18#endif
19 {
20 private:
21 static constexpr std::array metadata_names{
22#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
23 std::string_view("data_villager_data"),
24#else
25 std::string_view("data_villager_profession_id"),
26#endif
27#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
28 std::string_view("data_villager_data_finalized"),
29#endif
30 };
31 protected:
32 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
33#if PROTOCOL_VERSION > 477 /* > 1.14 */
35#else
37#endif
38
39 public:
41 virtual ~VillagerEntity();
42
43 // Object related stuff
44 virtual std::string GetName() const override;
45 virtual EntityType GetType() const override;
46
47 // Static stuff, for easier comparison
48 static std::string GetClassName();
49 static EntityType GetClassType();
50
51
52 virtual ProtocolCraft::Json::Value Serialize() const override;
53
54 // Metadata stuff
55#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
57#else
58 int GetDataVillagerProfessionId() const;
59#endif
60#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
62#endif
63
64
65#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
66 void SetDataVillagerData(const VillagerData& data_villager_data);
67#else
68 void SetDataVillagerProfessionId(const int data_villager_profession_id);
69#endif
70#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
71 void SetDataVillagerDataFinalized(const bool data_villager_data_finalized);
72#endif
73
74 protected:
75 virtual double GetWidthImpl() const override;
76 virtual double GetHeightImpl() const override;
77
78 };
79}
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
bool GetDataVillagerDataFinalized() const
virtual std::string GetName() const override
VillagerData GetDataVillagerData() const
virtual double GetHeightImpl() const override
static constexpr std::array metadata_names
virtual EntityType GetType() const override
static constexpr int metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataVillagerData(const VillagerData &data_villager_data)
static constexpr int hierarchy_metadata_count
static std::string GetClassName()
virtual double GetWidthImpl() const override
static EntityType GetClassType()
void SetDataVillagerDataFinalized(const bool data_villager_data_finalized)
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45