Botcraft 26.3
Loading...
Searching...
No Matches
PolarBearEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
17
22
23
24 std::string PolarBearEntity::GetName() const
25 {
26 return "polar_bear";
27 }
28
33
34
36 {
37 return "polar_bear";
38 }
39
44
45
47 {
49
50 output["metadata"]["data_standing_id"] = GetDataStandingId();
51
52 output["attributes"]["attack_damage"] = GetAttributeAttackDamageValue();
53
54 return output;
55 }
56
57
59 {
60 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_standing_id"));
61 }
62
63
64 void PolarBearEntity::SetDataStandingId(const bool data_standing_id)
65 {
66 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_standing_id"), data_standing_id);
67 }
68
69
71 {
72 std::shared_lock<std::shared_mutex> lock(entity_mutex);
74 }
75
76
78 {
79#if PROTOCOL_VERSION > 404 /* > 1.13.2 */
80 return 1.4;
81#else
82 return 1.3;
83#endif
84 }
85
87 {
88 return 1.4;
89 }
90
91}
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
std::map< EntityAttribute::Type, EntityAttribute > attributes
static std::string GetClassName()
void SetDataStandingId(const bool data_standing_id)
virtual std::string GetName() const override
virtual double GetWidthImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
double GetAttributeAttackDamageValue() const
static constexpr int metadata_count
virtual double GetHeightImpl() const override
virtual EntityType GetType() const override
static EntityType GetClassType()
static constexpr int hierarchy_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