Botcraft 26.3
Loading...
Searching...
No Matches
EnderManEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
10 SetDataCreepy(false);
11#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
12 SetDataStaredAt(false);
13#endif
14
15 // Initialize all attributes with default values
20#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
22#endif
23 }
24
29
30
31 std::string EnderManEntity::GetName() const
32 {
33 return "enderman";
34 }
35
40
41
43 {
44 return "enderman";
45 }
46
51
52
54 {
56
57 output["metadata"]["data_carry_state"] = GetDataCarryState();
58 output["metadata"]["data_creepy"] = GetDataCreepy();
59#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
60 output["metadata"]["data_stared_at"] = GetDataStaredAt();
61#endif
62
63 return output;
64 }
65
66
68 {
69 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_carry_state"));
70 }
71
73 {
74 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_creepy"));
75 }
76
77#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
79 {
80 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_stared_at"));
81 }
82#endif
83
84
85 void EnderManEntity::SetDataCarryState(const int data_carry_state)
86 {
87 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_carry_state"), data_carry_state);
88 }
89
90 void EnderManEntity::SetDataCreepy(const bool data_creepy)
91 {
92 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_creepy"), data_creepy);
93 }
94
95#if PROTOCOL_VERSION > 498 /* > 1.14.4 */
96 void EnderManEntity::SetDataStaredAt(const bool data_stared_at)
97 {
98 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_stared_at"), data_stared_at);
99 }
100#endif
101
102
104 {
105 return 0.6;
106 }
107
109 {
110 return 2.9;
111 }
112
113}
void SetDataCarryState(const int data_carry_state)
virtual std::string GetName() const override
virtual double GetWidthImpl() const override
void SetDataStaredAt(const bool data_stared_at)
static constexpr int hierarchy_metadata_count
virtual double GetHeightImpl() const override
static EntityType GetClassType()
virtual ProtocolCraft::Json::Value Serialize() const override
static std::string GetClassName()
void SetDataCreepy(const bool data_creepy)
static constexpr int metadata_count
virtual EntityType GetType() const override
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::vector< std::any > metadata
Definition Entity.hpp:335
std::map< EntityAttribute::Type, EntityAttribute > attributes
virtual ProtocolCraft::Json::Value Serialize() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45
#define BOTCRAFT_ENTITY_METADATA_INDEX(name)
Definition Entity.hpp:347