Botcraft 26.3
Loading...
Searching...
No Matches
BoggedEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 765 /* > 1.20.4 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
10 SetDataSheared(false);
11
12 // Initialize all attributes with default values
14 }
15
20
21
22 std::string BoggedEntity::GetName() const
23 {
24 return "bogged";
25 }
26
31
32
34 {
35 return "bogged";
36 }
37
42
43
45 {
47
48 output["metadata"]["data_sheared"] = GetDataSheared();
49
50 return output;
51 }
52
53
55 {
56 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_sheared"));
57 }
58
59
60 void BoggedEntity::SetDataSheared(const bool data_sheared)
61 {
62 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_sheared"), data_sheared);
63 }
64
65
67 {
68 return 0.6;
69 }
70
72 {
73 return 1.99;
74 }
75
76}
77#endif
static EntityType GetClassType()
static std::string GetClassName()
virtual EntityType GetType() const override
virtual std::string GetName() const override
virtual double GetHeightImpl() const override
void SetDataSheared(const bool data_sheared)
bool GetDataSheared() const
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr int hierarchy_metadata_count
static constexpr int metadata_count
virtual double GetWidthImpl() const override
void SetMetadata(const int index, const std::any &value)
Definition Entity.cpp:366
virtual ProtocolCraft::Json::Value Serialize() const
Definition Entity.cpp:1246
std::vector< std::any > metadata
Definition Entity.hpp:335
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