Botcraft
26.3
Loading...
Searching...
No Matches
StriderEntity.hpp
Go to the documentation of this file.
1
#if PROTOCOL_VERSION > 578
/* > 1.15.2 */
2
#pragma once
3
4
#include "
botcraft/Game/Entities/entities/animal/AnimalEntity.hpp
"
5
6
namespace
Botcraft
7
{
8
class
StriderEntity
:
public
AnimalEntity
9
{
10
private
:
11
static
constexpr
std::array
metadata_names
{
12
std::string_view(
"data_boost_time"
),
13
std::string_view(
"data_suffocating"
),
14
#if PROTOCOL_VERSION < 770
/* < 1.21.5 */
15
std::string_view(
"data_saddle_id"
),
16
#endif
17
};
18
protected
:
19
static
constexpr
int
metadata_count
=
static_cast<
int
>
(
metadata_names
.size());
20
static
constexpr
int
hierarchy_metadata_count
=
AnimalEntity::metadata_count
+
AnimalEntity::hierarchy_metadata_count
;
21
22
public
:
23
StriderEntity
();
24
virtual
~StriderEntity
();
25
26
// Object related stuff
27
virtual
std::string
GetName
()
const override
;
28
virtual
EntityType
GetType
()
const override
;
29
30
// Static stuff, for easier comparison
31
static
std::string
GetClassName
();
32
static
EntityType
GetClassType
();
33
34
35
virtual
ProtocolCraft::Json::Value
Serialize
()
const override
;
36
37
// Metadata stuff
38
int
GetDataBoostTime
()
const
;
39
bool
GetDataSuffocating
()
const
;
40
#if PROTOCOL_VERSION < 770
/* < 1.21.5 */
41
bool
GetDataSaddleId()
const
;
42
#endif
43
44
void
SetDataBoostTime
(
const
int
data_boost_time);
45
void
SetDataSuffocating
(
const
bool
data_suffocating);
46
#if PROTOCOL_VERSION < 770
/* < 1.21.5 */
47
void
SetDataSaddleId(
const
bool
data_saddle_id);
48
#endif
49
50
// Attribute stuff
51
#if PROTOCOL_VERSION < 767
/* < 1.21 */
52
// 9e362924-01de-4ddd-a2b2-d0f7a405a174
53
static
constexpr
std::array<unsigned char, 16>
suffocating_modifier_key
= { 0x9E, 0x36, 0x29, 0x24, 0x1, 0xDE, 0x4D, 0xDD, 0xA2, 0xB2, 0xD0, 0xF7, 0xA4, 0x5, 0xA1, 0x74 };
54
#else
55
inline
static
const
std::string
suffocating_modifier_key
=
"minecraft:suffocating"
;
56
#endif
57
58
59
protected
:
60
virtual
double
GetWidthImpl
()
const override
;
61
virtual
double
GetHeightImpl
()
const override
;
62
63
};
64
}
65
#endif
AnimalEntity.hpp
Botcraft::AnimalEntity
Definition
AnimalEntity.hpp:8
Botcraft::AnimalEntity::metadata_count
static constexpr int metadata_count
Definition
AnimalEntity.hpp:10
Botcraft::AnimalEntity::hierarchy_metadata_count
static constexpr int hierarchy_metadata_count
Definition
AnimalEntity.hpp:11
Botcraft::StriderEntity
Definition
StriderEntity.hpp:9
Botcraft::StriderEntity::metadata_names
static constexpr std::array metadata_names
Definition
StriderEntity.hpp:11
Botcraft::StriderEntity::GetClassType
static EntityType GetClassType()
Definition
StriderEntity.cpp:45
Botcraft::StriderEntity::GetType
virtual EntityType GetType() const override
Definition
StriderEntity.cpp:34
Botcraft::StriderEntity::GetDataSuffocating
bool GetDataSuffocating() const
Definition
StriderEntity.cpp:70
Botcraft::StriderEntity::Serialize
virtual ProtocolCraft::Json::Value Serialize() const override
Definition
StriderEntity.cpp:51
Botcraft::StriderEntity::metadata_count
static constexpr int metadata_count
Definition
StriderEntity.hpp:19
Botcraft::StriderEntity::GetDataBoostTime
int GetDataBoostTime() const
Definition
StriderEntity.cpp:65
Botcraft::StriderEntity::hierarchy_metadata_count
static constexpr int hierarchy_metadata_count
Definition
StriderEntity.hpp:20
Botcraft::StriderEntity::SetDataBoostTime
void SetDataBoostTime(const int data_boost_time)
Definition
StriderEntity.cpp:83
Botcraft::StriderEntity::GetClassName
static std::string GetClassName()
Definition
StriderEntity.cpp:40
Botcraft::StriderEntity::~StriderEntity
virtual ~StriderEntity()
Definition
StriderEntity.cpp:23
Botcraft::StriderEntity::GetHeightImpl
virtual double GetHeightImpl() const override
Definition
StriderEntity.cpp:106
Botcraft::StriderEntity::StriderEntity
StriderEntity()
Definition
StriderEntity.cpp:6
Botcraft::StriderEntity::GetWidthImpl
virtual double GetWidthImpl() const override
Definition
StriderEntity.cpp:101
Botcraft::StriderEntity::suffocating_modifier_key
static const std::string suffocating_modifier_key
Definition
StriderEntity.hpp:55
Botcraft::StriderEntity::SetDataSuffocating
void SetDataSuffocating(const bool data_suffocating)
Definition
StriderEntity.cpp:88
Botcraft::StriderEntity::GetName
virtual std::string GetName() const override
Definition
StriderEntity.cpp:29
ProtocolCraft::Json::Value
Main class, basically a JsonVariant with extra utility functions it doesn't inherit JsonVariant direc...
Definition
Json.hpp:45
Botcraft
Definition
BaseNode.hpp:6
Botcraft::EntityType
EntityType
Definition
Entity.hpp:355
botcraft
include
botcraft
Game
Entities
entities
monster
StriderEntity.hpp
Generated by
1.9.8