Botcraft 1.21.4
Loading...
Searching...
No Matches
PiglinEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
2#pragma once
3
4#if PROTOCOL_VERSION > 736 /* > 1.16.1 */
6#else
8#endif
9
10namespace Botcraft
11{
12#if PROTOCOL_VERSION > 736 /* > 1.16.1 */
14#else
15 class PiglinEntity : public MonsterEntity
16#endif
17 {
18 protected:
19#if PROTOCOL_VERSION > 736 /* > 1.16.1 */
20 static constexpr int metadata_count = 3;
21#else
22 static constexpr int metadata_count = 4;
23#endif
24 static const std::array<std::string, metadata_count> metadata_names;
25#if PROTOCOL_VERSION > 736 /* > 1.16.1 */
27#else
29#endif
30
31 public:
33 virtual ~PiglinEntity();
34
35 // Object related stuff
36 virtual std::string GetName() const override;
37 virtual EntityType GetType() const override;
38
39 // Static stuff, for easier comparison
40 static std::string GetClassName();
41 static EntityType GetClassType();
42
43
44 virtual ProtocolCraft::Json::Value Serialize() const override;
45
46 // Metadata stuff
47 virtual void SetMetadataValue(const int index, const std::any& value) override;
48
49 bool GetDataBabyId() const;
50#if PROTOCOL_VERSION < 737 /* < 1.16.2 */
52#endif
53 bool GetDataIsChargingCrossbow() const;
54 bool GetDataIsDancing() const;
55
56 void SetDataBabyId(const bool data_baby_id);
57#if PROTOCOL_VERSION < 737 /* < 1.16.2 */
58 void SetDataImmuneToZombification(const bool data_immune_to_zombification);
59#endif
60 void SetDataIsChargingCrossbow(const bool data_is_charging_crossbow);
61 void SetDataIsDancing(const bool data_is_dancing);
62
63 // Attribute stuff
64
65#if PROTOCOL_VERSION < 767 /* < 1.21 */
66 // 766bfa64-11f3-11ea-8d71-362b9e155667
67 static constexpr std::array<unsigned char, 16> speed_modifier_baby_key = { 0x76, 0x6B, 0xFA, 0x64, 0x11, 0xF3, 0x11, 0xEA, 0x8D, 0x71, 0x36, 0x2B, 0x9E, 0x15, 0x56, 0x67 };
68#else
69 inline static const std::string speed_modifier_baby_key = "minecraft:baby";
70#endif
71
72
73 protected:
74 virtual double GetWidthImpl() const override;
75 virtual double GetHeightImpl() const override;
76
77 };
78}
79#endif
static constexpr int hierarchy_metadata_count
void SetDataImmuneToZombification(const bool data_immune_to_zombification)
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
virtual double GetHeightImpl() const override
virtual std::string GetName() const override
void SetDataIsChargingCrossbow(const bool data_is_charging_crossbow)
bool GetDataIsChargingCrossbow() const
static EntityType GetClassType()
virtual void SetMetadataValue(const int index, const std::any &value) override
void SetDataIsDancing(const bool data_is_dancing)
static const std::array< std::string, metadata_count > metadata_names
virtual ProtocolCraft::Json::Value Serialize() const override
static std::string GetClassName()
void SetDataBabyId(const bool data_baby_id)
bool GetDataIsDancing() const
static constexpr int metadata_count
static const std::string speed_modifier_baby_key
virtual double GetWidthImpl() const override
static constexpr int hierarchy_metadata_count
virtual EntityType GetType() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45