Botcraft 26.3
Loading...
Searching...
No Matches
SlimeEntity.hpp
Go to the documentation of this file.
1#pragma once
2
3#if PROTOCOL_VERSION < 776 /* < 26.2 */
5#else
7#endif
8
9namespace Botcraft
10{
11#if PROTOCOL_VERSION < 776 /* < 26.2 */
12 class SlimeEntity : public MobEntity
13#else
15#endif
16 {
17#if PROTOCOL_VERSION < 776 /* < 26.2 */
18 private:
19 static constexpr std::array metadata_names{
20 std::string_view("id_size"),
21 };
22#endif
23 protected:
24#if PROTOCOL_VERSION < 776 /* < 26.2 */
25 static constexpr int metadata_count = static_cast<int>(metadata_names.size());
27#else
28 static constexpr int metadata_count = 0;
30#endif
31
32 public:
34 virtual ~SlimeEntity();
35
36 // Object related stuff
37 virtual std::string GetName() const override;
38 virtual EntityType GetType() const override;
39
40 // Static stuff, for easier comparison
41 static std::string GetClassName();
42 static EntityType GetClassType();
43
44
45#if PROTOCOL_VERSION < 776 /* < 26.2 */
46 virtual ProtocolCraft::Json::Value Serialize() const override;
47
48 // Metadata stuff
49 int GetIdSize() const;
50
51 void SetIdSize(const int id_size);
52
53 protected:
54 void OnMetadataChangedImpl(const int index) override;
55 int GetIdSizeImpl() const;
56 void SizeChanged(const int new_size);
57#else
58 protected:
59 virtual void SizeChanged(const int new_size) override;
60#endif
61
62 protected:
63 virtual double GetWidthImpl() const override;
64 virtual double GetHeightImpl() const override;
65 };
66}
virtual ProtocolCraft::Json::Value Serialize() const override
static constexpr std::array metadata_names
void OnMetadataChangedImpl(const int index) override
static constexpr int hierarchy_metadata_count
Definition MobEntity.hpp:15
static constexpr int metadata_count
Definition MobEntity.hpp:14
virtual double GetHeightImpl() const override
static constexpr int hierarchy_metadata_count
static std::string GetClassName()
virtual void SizeChanged(const int new_size) override
static EntityType GetClassType()
static constexpr int metadata_count
virtual std::string GetName() const override
virtual EntityType GetType() const override
virtual double GetWidthImpl() const override
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition Json.hpp:45