Botcraft 26.3
Loading...
Searching...
No Matches
HoglinEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 578 /* > 1.15.2 */
3
4namespace Botcraft
5{
19
24
25
26 std::string HoglinEntity::GetName() const
27 {
28 return "hoglin";
29 }
30
35
36
38 {
39 return "hoglin";
40 }
41
46
47
49 {
51
52 output["metadata"]["data_immune_to_zombification"] = GetDataImmuneToZombification();
53
54 output["attributes"]["attack_damage"] = GetAttributeAttackDamageValue();
55
56 return output;
57 }
58
59
61 {
62 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_immune_to_zombification"));
63 }
64
65
66 void HoglinEntity::SetDataImmuneToZombification(const bool data_immune_to_zombification)
67 {
68 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_immune_to_zombification"), data_immune_to_zombification);
69 }
70
71
73 {
74 std::shared_lock<std::shared_mutex> lock(entity_mutex);
76 }
77
78
80 {
81 return 1.3964844;
82 }
83
85 {
86 return 1.4;
87 }
88
89}
90#endif
virtual ProtocolCraft::Json::Value Serialize() const override
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
virtual std::string GetName() const override
void SetDataImmuneToZombification(const bool data_immune_to_zombification)
static EntityType GetClassType()
static std::string GetClassName()
virtual double GetWidthImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
virtual double GetHeightImpl() const override
static constexpr int metadata_count
virtual EntityType GetType() const override
double GetAttributeAttackDamageValue() const
bool GetDataImmuneToZombification() const
static constexpr int hierarchy_metadata_count
std::map< EntityAttribute::Type, EntityAttribute > attributes
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