Botcraft 26.3
Loading...
Searching...
No Matches
AbstractChestedHorseEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9 SetDataIdChest(false);
10
11 // Initialize all attributes with default values
13#if PROTOCOL_VERSION < 766 /* < 1.20.5 */
14 attributes.insert({ EntityAttribute::Type::HorseJumpStrength, EntityAttribute(EntityAttribute::Type::HorseJumpStrength, 0.5) });
15#else
17#endif
18 }
19
24
26 {
27 return true;
28 }
29
30
32 {
34
35 output["metadata"]["data_id_chest"] = GetDataIdChest();
36
37 return output;
38 }
39
40
42 {
43 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_chest"));
44 }
45
46
47 void AbstractChestedHorseEntity::SetDataIdChest(const bool data_id_chest)
48 {
49 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("data_id_chest"), data_id_chest);
50 }
51
52}
virtual ProtocolCraft::Json::Value Serialize() const override
virtual bool IsAbstractChestedHorse() const override
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
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