Botcraft 26.3
Loading...
Searching...
No Matches
CushionEntity.cpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 776 /* > 26.2 */
3
4namespace Botcraft
5{
7 {
8 // Initialize all metadata with default values
10 SetDataColor(0);
11 }
12
17
18
19 std::string CushionEntity::GetName() const
20 {
21 return "cushion";
22 }
23
28
29
31 {
32 return "cushion";
33 }
34
39
40
42 {
44
45 output["metadata"]["data_color"] = GetDataColor();
46
47 return output;
48 }
49
50
52 {
53 return GetMetadata<int>(BOTCRAFT_ENTITY_METADATA_INDEX("data_color"));
54 }
55
56
57 void CushionEntity::SetDataColor(const int data_color)
58 {
59 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_color"), data_color);
60 }
61
62
64 {
65 return 1.0;
66 }
67
69 {
70 return 0.25;
71 }
72
73}
74#endif
virtual double GetWidthImpl() const override
virtual EntityType GetType() const override
void SetDataColor(const int data_color)
static EntityType GetClassType()
static constexpr int metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
virtual std::string GetName() const override
static constexpr int hierarchy_metadata_count
virtual double GetHeightImpl() const override
static std::string GetClassName()
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
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