Botcraft 26.1.1
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 protected:
21#if PROTOCOL_VERSION < 775 /* < 26.1 */
22 static constexpr int metadata_count = 1;
23#else
24 static constexpr int metadata_count = 2;
25#endif
26 static const std::array<std::string, metadata_count> metadata_names;
27#if PROTOCOL_VERSION > 477 /* > 1.14 */
29#else
31#endif
32
33 public:
35 virtual ~VillagerEntity();
36
37 // Object related stuff
38 virtual std::string GetName() const override;
39 virtual EntityType GetType() const override;
40
41 // Static stuff, for easier comparison
42 static std::string GetClassName();
43 static EntityType GetClassType();
44
45
46 virtual ProtocolCraft::Json::Value Serialize() const override;
47
48 // Metadata stuff
49 virtual void SetMetadataValue(const int index, const std::any& value) override;
50
51#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
53#else
54 int GetDataVillagerProfessionId() const;
55#endif
56#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
58#endif
59
60
61#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
62 void SetDataVillagerData(const VillagerData& data_villager_data);
63#else
64 void SetDataVillagerProfessionId(const int data_villager_profession_id);
65#endif
66#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
67 void SetDataVillagerDataFinalized(const bool data_villager_data_finalized);
68#endif
69
70 protected:
71 virtual double GetWidthImpl() const override;
72 virtual double GetHeightImpl() const override;
73
74 };
75}
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
bool GetDataVillagerDataFinalized() const
virtual void SetMetadataValue(const int index, const std::any &value) override
virtual std::string GetName() const override
VillagerData GetDataVillagerData() const
static const std::array< std::string, metadata_count > metadata_names
virtual double GetHeightImpl() const override
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