Botcraft 26.3
Loading...
Searching...
No Matches
ZombieEntity.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_baby_id"),
12 std::string_view("data_special_type_id"),
13#if PROTOCOL_VERSION < 405 /* < 1.14 */
14 std::string_view("data_are_hands_up"),
15#endif
16#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
17 std::string_view("data_drowned_conversion_id"),
18#endif
19 };
20 protected:
21 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
23
24 public:
26 virtual ~ZombieEntity();
27
28 // Object related stuff
29 virtual std::string GetName() const override;
30 virtual EntityType GetType() const override;
31
32 // Static stuff, for easier comparison
33 static std::string GetClassName();
34 static EntityType GetClassType();
35
36
37 virtual ProtocolCraft::Json::Value Serialize() const override;
38
39 // Metadata stuff
40 bool GetDataBabyId() const;
41 int GetDataSpecialTypeId() const;
42#if PROTOCOL_VERSION < 405 /* < 1.14 */
43 bool GetDataAreHandsUp() const;
44#endif
45#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
46 bool GetDataDrownedConversionId() const;
47#endif
48
49 void SetDataBabyId(const bool data_baby_id);
50 void SetDataSpecialTypeId(const int data_special_type_id);
51#if PROTOCOL_VERSION < 405 /* < 1.14 */
52 void SetDataAreHandsUp(const bool data_are_hands_up);
53#endif
54#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
55 void SetDataDrownedConversionId(const bool data_drowned_conversion_id);
56#endif
57
58 // Attribute stuff
60
61#if PROTOCOL_VERSION < 767 /* < 1.21 */
62 // b9766b59-9566-4402-bc1f-2ee2a276d836
63 static constexpr std::array<unsigned char, 16> speed_modifier_baby_key = { 0xB9, 0x76, 0x6B, 0x59, 0x95, 0x66, 0x44, 0x2, 0xBC, 0x1F, 0x2E, 0xE2, 0xA2, 0x76, 0xD8, 0x36 };
64#else
65 inline static const std::string speed_modifier_baby_key = "minecraft:baby";
66 inline static const std::string reinforcement_caller_charge_key = "minecraft:reinforcement_caller_charge";
67 inline static const std::string zombie_reinforcement_callee_charge_key = "minecraft:reinforcement_callee_charge";
68 inline static const std::string leader_zombie_bonus_key = "minecraft:leader_zombie_bonus";
69 inline static const std::string zombie_random_spawn_bonus_key = "minecraft:zombie_random_spawn_bonus";
70#endif
71
72
73 protected:
74 virtual double GetWidthImpl() const override;
75 virtual double GetHeightImpl() const override;
76
77 };
78}
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
static constexpr int hierarchy_metadata_count
static const std::string zombie_reinforcement_callee_charge_key
bool GetDataDrownedConversionId() const
static EntityType GetClassType()
static const std::string leader_zombie_bonus_key
static std::string GetClassName()
static const std::string speed_modifier_baby_key
virtual ProtocolCraft::Json::Value Serialize() const override
static const std::string reinforcement_caller_charge_key
virtual double GetWidthImpl() const override
int GetDataSpecialTypeId() const
virtual EntityType GetType() const override
static constexpr std::array metadata_names
virtual std::string GetName() const override
virtual double GetHeightImpl() const override
void SetDataDrownedConversionId(const bool data_drowned_conversion_id)
double GetAttributeSpawnReinforcementsChanceValue() const
static constexpr int metadata_count
static const std::string zombie_random_spawn_bonus_key
void SetDataSpecialTypeId(const int data_special_type_id)
void SetDataBabyId(const bool data_baby_id)
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45