Botcraft 1.21.4
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 static constexpr int metadata_count = 1;
22 static const std::array<std::string, metadata_count> metadata_names;
23#if PROTOCOL_VERSION > 477 /* > 1.14 */
25#else
27#endif
28
29 public:
31 virtual ~VillagerEntity();
32
33 // Object related stuff
34 virtual std::string GetName() const override;
35 virtual EntityType GetType() const override;
36
37 // Static stuff, for easier comparison
38 static std::string GetClassName();
39 static EntityType GetClassType();
40
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#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
49
50 void SetDataVillagerData(const VillagerData& data_villager_data);
51#else
52 int GetDataVillagerProfessionId() const;
53
54 void SetDataVillagerProfessionId(const int data_villager_profession_id);
55#endif
56
57 protected:
58 virtual double GetWidthImpl() const override;
59 virtual double GetHeightImpl() const override;
60
61 };
62}
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
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()
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45