Botcraft 26.3
Loading...
Searching...
No Matches
WitherBossEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
21
26
27
28 std::string WitherBossEntity::GetName() const
29 {
30 return "wither";
31 }
32
37
38
40 {
41 return "wither";
42 }
43
48
49
51 {
53
54 output["metadata"]["data_target_a"] = GetDataTargetA();
55 output["metadata"]["data_target_b"] = GetDataTargetB();
56 output["metadata"]["data_target_c"] = GetDataTargetC();
57 output["metadata"]["data_id_inv"] = GetDataIdInv();
58
59 output["attributes"]["flying_speed"] = GetAttributeFlyingSpeedValue();
60
61 return output;
62 }
63
64
66 {
67 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_a"));
68 }
69
71 {
72 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_b"));
73 }
74
76 {
77 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_c"));
78 }
79
81 {
82 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_inv"));
83 }
84
85
86 void WitherBossEntity::SetDataTargetA(const int data_target_a)
87 {
88 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_a"), data_target_a);
89 }
90
91 void WitherBossEntity::SetDataTargetB(const int data_target_b)
92 {
93 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_b"), data_target_b);
94 }
95
96 void WitherBossEntity::SetDataTargetC(const int data_target_c)
97 {
98 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_target_c"), data_target_c);
99 }
100
101 void WitherBossEntity::SetDataIdInv(const int data_id_inv)
102 {
103 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_inv"), data_id_inv);
104 }
105
106
108 {
109 std::shared_lock<std::shared_mutex> lock(entity_mutex);
111 }
112
113
115 {
116 return 0.9;
117 }
118
120 {
121 return 3.5;
122 }
123
124}
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
std::shared_mutex entity_mutex
Definition Entity.hpp:320
std::vector< std::any > metadata
Definition Entity.hpp:335
std::map< EntityAttribute::Type, EntityAttribute > attributes
virtual ProtocolCraft::Json::Value Serialize() const override
virtual ProtocolCraft::Json::Value Serialize() const override
static std::string GetClassName()
virtual double GetWidthImpl() const override
static constexpr int hierarchy_metadata_count
virtual double GetHeightImpl() const override
void SetDataIdInv(const int data_id_inv)
void SetDataTargetC(const int data_target_c)
void SetDataTargetA(const int data_target_a)
void SetDataTargetB(const int data_target_b)
virtual EntityType GetType() const override
static EntityType GetClassType()
virtual std::string GetName() const override
double GetAttributeFlyingSpeedValue() const
static constexpr int metadata_count
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