Botcraft 26.3
Loading...
Searching...
No Matches
SheepEntity.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 SheepEntity::GetName() const
23 {
24 return "sheep";
25 }
26
31
32
34 {
35 return "sheep";
36 }
37
42
43
45 {
47
48 output["metadata"]["data_wool_id"] = GetDataWoolId();
49
50 return output;
51 }
52
53
55 {
56 return GetMetadata<char>(BOTCRAFT_ENTITY_METADATA_INDEX("data_wool_id"));
57 }
58
59
60 void SheepEntity::SetDataWoolId(const char data_wool_id)
61 {
62 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_wool_id"), data_wool_id);
63 }
64
65
67 {
68 return 0.9;
69 }
70
72 {
73 return 1.3;
74 }
75
76}
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
virtual double GetWidthImpl() const override
static constexpr int metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
virtual double GetHeightImpl() const override
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
virtual std::string GetName() const override
void SetDataWoolId(const char data_wool_id)
char GetDataWoolId() const
static std::string GetClassName()
virtual EntityType GetType() 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