Botcraft 1.21.4
Loading...
Searching...
No Matches
SalmonEntity.hpp
Go to the documentation of this file.
1#if PROTOCOL_VERSION > 340 /* > 1.12.2 */
2#pragma once
3
5
6namespace Botcraft
7{
9 {
10 protected:
11#if PROTOCOL_VERSION < 768 /* < 1.21.2 */
12 static constexpr int metadata_count = 0;
13#else
14 static constexpr int metadata_count = 1;
15 static const std::array<std::string, metadata_count> metadata_names;
16#endif
18
19 public:
21 virtual ~SalmonEntity();
22
23 // Object related stuff
24 virtual std::string GetName() const override;
25 virtual EntityType GetType() const override;
26
27 // Static stuff, for easier comparison
28 static std::string GetClassName();
29 static EntityType GetClassType();
30
31#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
32 virtual ProtocolCraft::Json::Value Serialize() const override;
33
34 // Metadata stuff
35 virtual void SetMetadataValue(const int index, const std::any& value) override;
36
37
38#if PROTOCOL_VERSION < 769 /* < 1.21.4 */
39 const std::string& GetDataType() const;
40 void SetDataType(const std::string& data_type);
41#else
42 int GetDataType() const;
43 void SetDataType(const int data_type);
44#endif
45#endif
46
47 protected:
48#if PROTOCOL_VERSION > 767 /* > 1.21.1 */
49#if PROTOCOL_VERSION < 769 /* < 1.21.4 */
50 const std::string& GetDataTypeImpl() const;
51#else
52 int GetDataTypeImpl() const;
53#endif
54 double GetScaleImpl() const;
55#endif
56 virtual double GetWidthImpl() const override;
57 virtual double GetHeightImpl() const override;
58
59 };
60}
61#endif
double GetScaleImpl() const
virtual ProtocolCraft::Json::Value Serialize() const override
static const std::array< std::string, metadata_count > metadata_names
static constexpr int metadata_count
virtual void SetMetadataValue(const int index, const std::any &value) override
static constexpr int hierarchy_metadata_count
static EntityType GetClassType()
virtual double GetHeightImpl() const override
virtual double GetWidthImpl() const override
virtual std::string GetName() const override
static std::string GetClassName()
void SetDataType(const int data_type)
virtual EntityType GetType() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45