Botcraft 26.3
Loading...
Searching...
No Matches
TadpoleEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 758 /* > 1.18.2 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
10#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
11 SetAgeLocked(false);
12#endif
13
14 // Initialize all attributes with default values
17 }
18
23
24
25 std::string TadpoleEntity::GetName() const
26 {
27 return "tadpole";
28 }
29
34
35
37 {
38 return "tadpole";
39 }
40
45
46
47#if PROTOCOL_VERSION > 774 /* > 1.21.11 */
49 {
51
52 output["metadata"]["age_locked"] = GetAgeLocked();
53
54 return output;
55 }
56
57
59 {
60 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("age_locked"));
61 }
62
63
64 void TadpoleEntity::SetAgeLocked(const bool age_locked)
65 {
66 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("age_locked"), age_locked);
67 }
68#endif
69
70
72 {
73 return 0.4;
74 }
75
77 {
78 return 0.3;
79 }
80
81}
82#endif
virtual ProtocolCraft::Json::Value Serialize() 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
static std::string GetClassName()
static constexpr int hierarchy_metadata_count
virtual double GetWidthImpl() const override
virtual std::string GetName() const override
static constexpr int metadata_count
void SetAgeLocked(const bool age_locked)
virtual ProtocolCraft::Json::Value Serialize() const override
virtual EntityType GetType() const override
static EntityType GetClassType()
virtual double GetHeightImpl() 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