Botcraft 26.3
Loading...
Searching...
No Matches
AbstractSkeletonEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9#if PROTOCOL_VERSION < 405 /* < 1.14 */
10 SetIsSwingingArms(false);
11#endif
12
13 // Initialize all attributes with default values
15 }
16
21
23 {
24 return true;
25 }
26
27
28#if PROTOCOL_VERSION < 405 /* < 1.14 */
30 {
32
33 output["metadata"]["is_swinging_arms"] = GetIsSwingingArms();
34
35 return output;
36 }
37
38
39 bool AbstractSkeletonEntity::GetIsSwingingArms() const
40 {
41 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("is_swinging_arms"));
42 }
43
44 void AbstractSkeletonEntity::SetIsSwingingArms(const bool is_swinging_arms)
45 {
46 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("is_swinging_arms"), is_swinging_arms);
47 }
48#endif
49
50}
virtual bool IsAbstractSkeleton() 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
virtual ProtocolCraft::Json::Value Serialize() 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