Botcraft 26.3
Loading...
Searching...
No Matches
AbstractFishEntity.cpp
Go to the documentation of this file.
2
3namespace Botcraft
4{
6 {
7 // Initialize all metadata with default values
9 SetFromBucket(false);
10
11 // Initialize all attributes with default values
13 }
14
19
21 {
22 return true;
23 }
24
25
27 {
29
30 output["metadata"]["from_bucket"] = GetFromBucket();
31
32 return output;
33 }
34
35
37 {
38 return GetMetadata<bool>(BOTCRAFT_ENTITY_METADATA_INDEX("from_bucket"));
39 }
40
41
42 void AbstractFishEntity::SetFromBucket(const bool from_bucket)
43 {
44 SetMetadata(BOTCRAFT_ENTITY_METADATA_INDEX("from_bucket"), from_bucket);
45 }
46
47}
virtual bool IsAbstractFish() const override
static constexpr int metadata_count
static constexpr int hierarchy_metadata_count
virtual ProtocolCraft::Json::Value Serialize() const override
void SetFromBucket(const bool from_bucket)
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
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