Botcraft 26.3
Loading...
Searching...
No Matches
SpiderEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
10
11 // Initialize all attributes with default values
14 }
15
20
21
22 std::string SpiderEntity::GetName() const
23 {
24 return "spider";
25 }
26
31
32
34 {
35 return "spider";
36 }
37
42
43
45 {
47
48 output["metadata"]["data_flags_id"] = GetDataFlagsId();
49
50 return output;
51 }
52
53
55 {
56 return GetMetadata<char>(BOTCRAFT_ENTITY_METADATA_INDEX("data_flags_id"));
57 }
58
59
60 void SpiderEntity::SetDataFlagsId(const char data_flags_id)
61 {
62 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_flags_id"), data_flags_id);
63 }
64
65
67 {
68 return 1.4;
69 }
70
72 {
73 return 0.9;
74 }
75
76}
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
virtual ProtocolCraft::Json::Value Serialize() const override
virtual double GetHeightImpl() const override
virtual ProtocolCraft::Json::Value Serialize() const override
void SetDataFlagsId(const char data_flags_id)
static constexpr int hierarchy_metadata_count
char GetDataFlagsId() const
static constexpr int metadata_count
virtual double GetWidthImpl() const override
virtual std::string GetName() const override
static EntityType GetClassType()
virtual EntityType GetType() const override
static std::string GetClassName()
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