Cuberite
A lightweight, fast and extensible game server for Minecraft
Entity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "../BoundingBox.h"
5 #include "../Item.h"
6 #include "../OSSupport/AtomicUniquePtr.h"
7 
8 
9 
10 
11 
12 // Place this macro in the public section of each cEntity descendant class and you're done :)
13 #define CLASS_PROTODEF(classname) \
14  virtual bool IsA(const char * a_ClassName) const override\
15  { \
16  return ((a_ClassName != nullptr) && ((strcmp(a_ClassName, #classname) == 0) || Super::IsA(a_ClassName))); \
17  } \
18  virtual const char * GetClass(void) const override \
19  { \
20  return #classname; \
21  } \
22  static const char * GetClassStatic(void) \
23  { \
24  return #classname; \
25  } \
26  virtual const char * GetParentClass(void) const override \
27  { \
28  return Super::GetClass(); \
29  }
30 
31 #define POSX_TOINT FloorC(GetPosX())
32 #define POSY_TOINT FloorC(GetPosY())
33 #define POSZ_TOINT FloorC(GetPosZ())
34 #define POS_TOINT GetPosition().Floor()
35 
36 #define GET_AND_VERIFY_CURRENT_CHUNK(ChunkVarName, X, Z) \
37  cChunk * ChunkVarName = a_Chunk.GetNeighborChunk(X, Z); \
38  do { \
39  if ((ChunkVarName == nullptr) || !ChunkVarName->IsValid()) \
40  { \
41  return; \
42  } \
43  } while (false)
44 
45 
46 
47 
48 class cWorld;
49 class cClientHandle;
50 class cPlayer;
51 class cChunk;
52 class cMonster;
53 
54 
55 
56 
57 
58 // tolua_begin
60 {
61  eDamageType DamageType; // Where does the damage come from? Being hit / on fire / contact with cactus / ...
62  cEntity * Attacker; // The attacking entity; valid only for dtAttack
63  int RawDamage; // What damage would the receiver get without any armor. Usually: attacker mob type + weapons
64  float FinalDamage; // What actual damage will be received. Usually: m_RawDamage minus armor
65  Vector3d Knockback; // The amount and direction of knockback received from the damage
66  // TODO: Effects - list of effects that the hit is causing. Unknown representation yet
67 } ;
68 // tolua_end
69 
70 
71 
72 
73 
74 // tolua_begin
75 class cEntity
76 {
77 protected:
80  {
84  };
85 
86 public:
87 
89  {
90  etEntity, // For all other types
105 
106  // Common variations
107  etMob = etMonster, // DEPRECATED, use etMonster instead!
108  } ;
109 
110  // tolua_end
111 
112  static const int FIRE_TICKS_PER_DAMAGE = 10;
113  static const int FIRE_DAMAGE = 1;
114  static const int LAVA_TICKS_PER_DAMAGE = 10;
115  static const int LAVA_DAMAGE = 4;
116  static const int BURN_TICKS_PER_DAMAGE = 20;
117  static const int BURN_DAMAGE = 1;
118 
119  static const int BURN_TICKS = 160;
120 
121  static const int MAX_AIR_LEVEL = 300;
122  static const int DROWNING_TICKS = 20;
123 
124  static const int VOID_BOUNDARY = -64;
125  static const int FALL_DAMAGE_HEIGHT = 4;
126 
128  static const UInt32 INVALID_ID = 0; // Exported to Lua in ManualBindings.cpp, ToLua doesn't parse initialized constants.
129 
130 
131  cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height);
132  virtual ~cEntity() = default;
133 
136  bool Initialize(OwnedEntity a_Self, cWorld & a_EntityWorld);
137 
139  void OnAcquireSpectator(cPlayer & a_Player);
140 
144  virtual void OnAddToWorld(cWorld & a_World);
145 
147  void OnLoseSpectator(cPlayer & a_Player);
148 
152  virtual void OnRemoveFromWorld(cWorld & a_World);
153 
154  // tolua_begin
155 
156  eEntityType GetEntityType(void) const { return m_EntityType; }
157 
158  bool IsArrow (void) const { return IsA("cArrowEntity"); }
159  bool IsEnderCrystal(void) const { return (m_EntityType == etEnderCrystal); }
160  bool IsPlayer (void) const { return (m_EntityType == etPlayer); }
161  bool IsPickup (void) const { return (m_EntityType == etPickup); }
162  bool IsMob (void) const { return (m_EntityType == etMonster); }
163  bool IsPawn (void) const { return (IsMob() || IsPlayer()); }
164  bool IsFallingBlock(void) const { return (m_EntityType == etFallingBlock); }
165  bool IsMinecart (void) const { return (m_EntityType == etMinecart); }
166  bool IsBoat (void) const { return (m_EntityType == etBoat); }
167  bool IsTNT (void) const { return (m_EntityType == etTNT); }
168  bool IsProjectile (void) const { return (m_EntityType == etProjectile); }
169  bool IsExpOrb (void) const { return (m_EntityType == etExpOrb); }
170  bool IsFloater (void) const { return (m_EntityType == etFloater); }
171  bool IsItemFrame (void) const { return (m_EntityType == etItemFrame); }
172  bool IsLeashKnot (void) const { return (m_EntityType == etLeashKnot); }
173  bool IsPainting (void) const { return (m_EntityType == etPainting); }
174 
176  virtual bool IsA(const char * a_ClassName) const;
177 
179  static const char * GetClassStatic(void);
180 
182  virtual const char * GetClass(void) const;
183 
185  virtual const char * GetParentClass(void) const;
186 
188  virtual bool DoesPreventBlockPlacement(void) const { return true; }
189 
190  cWorld * GetWorld(void) const { return m_World; }
191 
192  double GetHeadYaw (void) const { return m_HeadYaw; } // In degrees
193  float GetHeight (void) const { return m_Height; }
194  double GetMass (void) const { return m_Mass; }
195  double GetPosX (void) const { return m_Position.x; }
196  double GetPosY (void) const { return m_Position.y; }
197  double GetPosZ (void) const { return m_Position.z; }
198  double GetYaw (void) const { return m_Rot.x; } // In degrees, [-180, +180)
199  double GetPitch (void) const { return m_Rot.y; } // In degrees, [-180, +180), but normal client clips to [-90, +90]
200  double GetRoll (void) const { return m_Rot.z; } // In degrees, unused in current client
201  Vector3d GetLookVector(void) const;
202  double GetSpeedX (void) const { return m_Speed.x; }
203  double GetSpeedY (void) const { return m_Speed.y; }
204  double GetSpeedZ (void) const { return m_Speed.z; }
205  float GetWidth (void) const { return m_Width; }
206 
207  int GetChunkX(void) const { return FloorC(m_Position.x / cChunkDef::Width); }
208  int GetChunkZ(void) const { return FloorC(m_Position.z / cChunkDef::Width); }
209 
210  // Get the Entity's axis aligned bounding box, with absolute (world-relative) coordinates.
212 
213  void SetHeadYaw (double a_HeadYaw);
214  void SetMass (double a_Mass);
215  void SetPosX (double a_PosX) { SetPosition({a_PosX, m_Position.y, m_Position.z}); }
216  void SetPosY (double a_PosY) { SetPosition({m_Position.x, a_PosY, m_Position.z}); }
217  void SetPosZ (double a_PosZ) { SetPosition({m_Position.x, m_Position.y, a_PosZ}); }
218  void SetPosition(double a_PosX, double a_PosY, double a_PosZ) { SetPosition({a_PosX, a_PosY, a_PosZ}); }
219  void SetPosition(const Vector3d & a_Position);
220  void SetYaw (double a_Yaw); // In degrees, normalizes to [-180, +180)
221  void SetPitch (double a_Pitch); // In degrees, normalizes to [-180, +180)
222  void SetRoll (double a_Roll); // In degrees, normalizes to [-180, +180)
223 
225  void SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ);
226 
228  void SetSpeed(Vector3d a_Speed) { SetSpeed(a_Speed.x, a_Speed.y, a_Speed.z); }
229 
231  void SetSpeedX(double a_SpeedX);
232 
234  void SetSpeedY(double a_SpeedY);
235 
237  void SetSpeedZ(double a_SpeedZ);
238 
239  void AddPosX (double a_AddPosX) { AddPosition(a_AddPosX, 0, 0); }
240  void AddPosY (double a_AddPosY) { AddPosition(0, a_AddPosY, 0); }
241  void AddPosZ (double a_AddPosZ) { AddPosition(0, 0, a_AddPosZ); }
242  void AddPosition(double a_AddPosX, double a_AddPosY, double a_AddPosZ) { SetPosition(m_Position + Vector3d(a_AddPosX, a_AddPosY, a_AddPosZ)); }
243  void AddPosition(const Vector3d & a_AddPos) { AddPosition(a_AddPos.x, a_AddPos.y, a_AddPos.z); }
244  void AddSpeed (double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ);
245  void AddSpeed (const Vector3d & a_AddSpeed) { AddSpeed(a_AddSpeed.x, a_AddSpeed.y, a_AddSpeed.z); }
246  void AddSpeedX (double a_AddSpeedX);
247  void AddSpeedY (double a_AddSpeedY);
248  void AddSpeedZ (double a_AddSpeedZ);
249 
250  virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways);
251  void SteerVehicle(float a_Forward, float a_Sideways);
252 
253  inline UInt32 GetUniqueID(void) const { return m_UniqueID; }
254 
256  inline bool IsDestroyed() const {return !IsTicking();}
257 
261  bool IsTicking(void) const;
262 
263  // tolua_end
265  void Destroy();
266  // tolua_begin
267 
269  void TakeDamage(cEntity & a_Attacker);
270 
272  void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, double a_KnockbackAmount);
273 
275  void TakeDamage(eDamageType a_DamageType, UInt32 a_Attacker, int a_RawDamage, double a_KnockbackAmount);
276 
278  void TakeDamage(eDamageType a_DamageType, cEntity * a_Attacker, int a_RawDamage, float a_FinalDamage, double a_KnockbackAmount);
279 
280  float GetGravity(void) const { return m_Gravity; }
281 
282  void SetGravity(float a_Gravity) { m_Gravity = a_Gravity; }
283 
284  float GetAirDrag(void) const { return m_AirDrag; }
285 
286  void SetAirDrag(float a_AirDrag) { m_AirDrag = a_AirDrag; }
287 
289  void SetYawFromSpeed(void);
290 
292  void SetPitchFromSpeed(void);
293 
294  // tolua_end
295 
297  const Vector3d & GetPosition(void) const { return m_Position; }
298 
300  const Vector3d & GetSpeed(void) const { return m_Speed; }
301 
305 
309  virtual bool DoTakeDamage(TakeDamageInfo & a_TDI);
310 
311  // tolua_begin
312 
314  virtual int GetRawDamageAgainst(const cEntity & a_Receiver);
315 
317  virtual bool ArmorCoversAgainst(eDamageType a_DamageType);
318 
320  virtual float GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_RawDamage);
321 
323  virtual float GetEnchantmentCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_Damage);
324 
328 
330  virtual double GetKnockbackAmountAgainst(const cEntity & a_Receiver);
331 
333  virtual cItem GetEquippedWeapon(void) const { return cItem(); }
334 
336  virtual cItem GetEquippedHelmet(void) const { return cItem(); }
337 
339  virtual cItem GetEquippedChestplate(void) const { return cItem(); }
340 
342  virtual cItem GetEquippedLeggings(void) const { return cItem(); }
343 
345  virtual cItem GetEquippedBoots(void) const { return cItem(); }
346 
348  virtual cItem GetOffHandEquipedItem(void) const { return cItem(); }
349 
351  virtual void ApplyArmorDamage(int DamageBlocked);
352 
353  // tolua_end
354 
356  virtual void KilledBy(TakeDamageInfo & a_TDI);
357 
358  // tolua_begin
359 
361  virtual void Killed(const cEntity & a_Victim, eDamageType a_DamageType) {}
362 
364  virtual void Heal(int a_HitPoints);
365 
367  float GetHealth(void) const { return m_Health; }
368 
370  void SetHealth(float a_Health);
371 
372  // tolua_end
373 
374  virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk);
375 
377  virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk & a_Chunk);
378 
380  virtual void TickBurning(cChunk & a_Chunk);
381 
383  virtual void DetectCacti(void);
384 
386  virtual void DetectMagma(void);
387 
391  virtual bool DetectPortal(void);
392 
394  virtual void TickInVoid(cChunk & a_Chunk);
395 
397  virtual void OnStartedBurning(void);
398 
400  virtual void OnFinishedBurning(void);
401 
402  // tolua_begin
403 
405  void SetMaxHealth(float a_MaxHealth);
406 
407  float GetMaxHealth(void) const { return m_MaxHealth; }
408 
410  void SetIsFireproof(bool a_IsFireproof);
411 
412  virtual bool IsFireproof(void) const { return m_IsFireproof; }
413 
415  void StartBurning(int a_TicksLeftBurning);
416 
418  void StopBurning(void);
419 
420  // tolua_end
421 
424  virtual void SpawnOn(cClientHandle & a_Client) = 0;
425 
426  // tolua_begin
427 
429  virtual void TeleportToEntity(cEntity & a_Entity);
430 
432  virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ);
433 
434  bool MoveToWorld(cWorld & a_World, Vector3d a_NewPosition, bool a_ShouldSetPortalCooldown = false, bool a_ShouldSendRespawn = true);
435 
436  bool MoveToWorld(cWorld & a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
437  {
438  return MoveToWorld(a_World, a_NewPosition, false, a_ShouldSendRespawn);
439  }
440 
442  bool MoveToWorld(cWorld & a_World, bool a_ShouldSendRespawn = true);
443 
445  bool MoveToWorld(const AString & a_WorldName, bool a_ShouldSendRespawn = true);
446 
447  // tolua_end
448 
451  {
452  return (m_WorldChangeInfo.m_NewWorld != nullptr);
453  }
454 
456  virtual void BroadcastMovementUpdate(const cClientHandle * a_Exclude = nullptr);
457 
459  cEntity * GetAttached();
460 
462  void AttachTo(cEntity & a_AttachTo);
463 
465  void Detach(void);
466 
468  bool IsAttachedTo(const cEntity * a_Entity) const;
469 
472  bool IsOrientationDirty() const;
473 
475  void WrapHeadYaw();
476 
478  void WrapRotation();
479 
481  void WrapSpeed();
482 
483  // tolua_begin
484 
485  // COMMON metadata flags; descendants may override the defaults:
486  virtual bool IsCrouched (void) const { return false; }
487  virtual bool IsElytraFlying(void) const { return false; }
488  virtual bool IsInvisible (void) const { return false; }
489  virtual bool IsOnFire (void) const { return m_TicksLeftBurning > 0; }
490  virtual bool IsRclking (void) const { return false; }
491  virtual bool IsRiding (void) const { return false; }
492  virtual bool IsSprinting (void) const { return false; }
493 
495  virtual bool IsInFire(void) const { return m_IsInFire; }
496 
498  virtual bool IsInLava(void) const { return m_IsInLava; }
499 
501  virtual bool IsInWater(void) const { return m_IsInWater; }
502 
504  virtual bool IsHeadInWater(void) const { return m_IsHeadInWater; }
505 
507  int GetAirLevel(void) const { return m_AirLevel; }
508 
510  long int GetTicksAlive(void) const { return m_TicksAlive; }
511 
513  int GetInvulnerableTicks(void) const { return m_InvulnerableTicks; }
514 
516  void SetInvulnerableTicks(int a_InvulnerableTicks) { m_InvulnerableTicks = a_InvulnerableTicks; }
517 
519  virtual bool IsOnGround(void) const { return m_bOnGround; }
520 
521  // tolua_end
522 
524  virtual void OnRightClicked(cPlayer & a_Player) {}
525 
527  virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = nullptr)
528  {
529  UNUSED(a_Drops);
530  UNUSED(a_Killer);
531  }
532 
534  void SetWorld(cWorld * a_World) { m_World = a_World; }
535 
538  void SetParentChunk(cChunk * a_Chunk);
539 
542  const cChunk * GetParentChunk() const { return m_ParentChunk; }
543 
545  void SetIsTicking(bool a_IsTicking);
546 
548  void SetSize(float a_Width, float a_Height);
549 
551  void AddLeashedMob(cMonster * a_Monster);
552 
554  void RemoveLeashedMob(cMonster * a_Monster);
555 
557  bool HasAnyMobLeashed() const { return m_LeashedMobs.size() > 0; }
558 
561 
562 protected:
563 
566  {
568  unsigned short m_TicksDelayed;
569 
573  };
574 
575 
578 
583 
584  float m_Health;
585  float m_MaxHealth;
586 
589 
592 
595 
598 
602 
605 
608  float m_Gravity;
609 
614  float m_AirDrag;
615 
619 
621 
623 
625 
628 
631 
634 
637 
640 
643 
646 
649 
652 
655 
658 
662 
665 
667  long int m_TicksAlive;
668 
671  void DoMoveToWorld(const sWorldChangeInfo & a_WorldChangeInfo);
672 
676  static void ApplyFriction(Vector3d & a_Speed, double a_SlowdownMultiplier, float a_Dt);
677 
679  virtual void HandleAir(void);
680 
683  virtual void SetSwimState(cChunk & a_Chunk);
684 
687  virtual void ResetPosition(Vector3d a_NewPos);
688 
690  void BroadcastLeashedMobs();
691 
693  virtual void OnDetach();
694 
695 private:
696 
699 
702 
704  double m_HeadYaw;
705 
708 
711 
714 
716  double m_Mass;
717 
719  float m_Width;
720 
722  float m_Height;
723 
727 
728  typedef std::list<cMonster *> cMonsterList;
729 
732 
734  std::vector<cPlayer *> m_Spectators;
735 } ; // tolua_export
FloorC
std::enable_if< std::is_arithmetic< T >::value, C >::type FloorC(T a_Value)
Floors a value, then casts it to C (an int by default).
Definition: Globals.h:344
cEntity::TakeDamage
void TakeDamage(cEntity &a_Attacker)
Makes this pawn take damage from an attack by a_Attacker.
Definition: Entity.cpp:272
cEntity::AddSpeedY
void AddSpeedY(double a_AddSpeedY)
Definition: Entity.cpp:2212
cEntity::VOID_BOUNDARY
static const int VOID_BOUNDARY
Y position to begin applying void damage.
Definition: Entity.h:124
cEntity::IsSprinting
virtual bool IsSprinting(void) const
Definition: Entity.h:492
cEntity::m_Spectators
std::vector< cPlayer * > m_Spectators
List of players who are spectating this entity.
Definition: Entity.h:734
cEntity::HandleSpeedFromAttachee
virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
Definition: Entity.cpp:2230
cClientHandle
Definition: ClientHandle.h:49
cEntity::IsArrow
bool IsArrow(void) const
Definition: Entity.h:158
cEntity::FIRE_DAMAGE
static const int FIRE_DAMAGE
Damage to deal when standing in fire.
Definition: Entity.h:113
cEntity::GetParentChunk
cChunk * GetParentChunk()
Returns the chunk responsible for ticking this entity.
Definition: Entity.h:541
cEntity::m_TicksAlive
long int m_TicksAlive
The number of ticks this entity has been alive for.
Definition: Entity.h:667
cEntity::MAX_AIR_LEVEL
static const int MAX_AIR_LEVEL
Maximum air an entity can have.
Definition: Entity.h:121
cEntity::m_PortalCooldownData
sPortalCooldownData m_PortalCooldownData
Portal delay timer and cooldown boolean data.
Definition: Entity.h:664
cEntity::SetHealth
void SetHealth(float a_Health)
Sets the health of this entity; doesn't broadcast any hurt animation.
Definition: Entity.cpp:899
cEntity::SetSpeed
void SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
Sets the speed of the entity, measured in m / sec.
Definition: Entity.cpp:2157
cChunkDef::Width
static const int Width
Definition: ChunkDef.h:107
cEntity::GetRawDamageAgainst
virtual int GetRawDamageAgainst(const cEntity &a_Receiver)
Returns the hitpoints that this pawn can deal to a_Receiver using its equipped items.
Definition: Entity.cpp:613
cEntity::m_ParentChunk
cChunk * m_ParentChunk
The chunk which is responsible for ticking this entity.
Definition: Entity.h:701
cEntity::GetParentChunk
const cChunk * GetParentChunk() const
Definition: Entity.h:542
cEntity::OnAddToWorld
virtual void OnAddToWorld(cWorld &a_World)
Called when the entity is added to a world.
Definition: Entity.cpp:147
Vector3::x
T x
Definition: Vector3.h:17
cEntity::IsPlayer
bool IsPlayer(void) const
Definition: Entity.h:160
cEntity::cMonsterList
std::list< cMonster * > cMonsterList
Definition: Entity.h:728
cEntity::GetUniqueID
UInt32 GetUniqueID(void) const
Definition: Entity.h:253
cEntity::etPlayer
@ etPlayer
Definition: Entity.h:92
cEntity::etLeashKnot
@ etLeashKnot
Definition: Entity.h:104
cEntity::SetSpeedZ
void SetSpeedZ(double a_SpeedZ)
Sets the speed in the Z axis, leaving the other speed components intact.
Definition: Entity.cpp:2185
cEntity::IsOrientationDirty
bool IsOrientationDirty() const
Returns whether the entity's orientation has been set manually.
Definition: Entity.cpp:2093
cEntity::GetEntityType
eEntityType GetEntityType(void) const
Definition: Entity.h:156
cEntity::sWorldChangeInfo
State variables for MoveToWorld.
Definition: Entity.h:79
cEntity::m_AttachedTo
cEntity * m_AttachedTo
The entity to which this entity is attached (vehicle), nullptr if none.
Definition: Entity.h:588
cEntity::TeleportToCoords
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ)
Teleports to the coordinates specified.
Definition: Entity.cpp:1952
cEntity::m_IsInFire
bool m_IsInFire
If any part of the entity is in a fire block.
Definition: Entity.h:648
TakeDamageInfo::DamageType
eDamageType DamageType
Definition: Entity.h:61
cEntity::SteerVehicle
void SteerVehicle(float a_Forward, float a_Sideways)
Definition: Entity.cpp:2243
cEntity::IsExpOrb
bool IsExpOrb(void) const
Definition: Entity.h:169
cEntity::sPortalCooldownData::m_ShouldPreventTeleportation
bool m_ShouldPreventTeleportation
Whether the entity has just exited the portal, and should therefore not be teleported again.
Definition: Entity.h:572
cEntity::m_TicksSinceLastFireDamage
int m_TicksSinceLastFireDamage
Time, in ticks, since the last damage dealt by standing in fire.
Definition: Entity.h:639
cEntity::DetectCacti
virtual void DetectCacti(void)
Detects the time for application of cacti damage.
Definition: Entity.cpp:1362
cEntity::etFallingBlock
@ etFallingBlock
Definition: Entity.h:95
cEntity::sPortalCooldownData::m_TicksDelayed
unsigned short m_TicksDelayed
Ticks since entry of portal, used to delay teleportation.
Definition: Entity.h:568
cEntity::etMob
@ etMob
Definition: Entity.h:107
cEntity::SetPosY
void SetPosY(double a_PosY)
Definition: Entity.h:216
cEntity::SetWorld
void SetWorld(cWorld *a_World)
Sets the internal world pointer to a new cWorld, doesn't update anything else.
Definition: Entity.h:534
TakeDamageInfo::FinalDamage
float FinalDamage
Definition: Entity.h:64
cEntity::m_bDirtyOrientation
bool m_bDirtyOrientation
Stores whether our yaw / pitch / roll (body orientation) has been set manually.
Definition: Entity.h:597
cEntity::AddPosY
void AddPosY(double a_AddPosY)
Definition: Entity.h:240
cEntity::m_LeashedMobs
cMonsterList m_LeashedMobs
List of leashed mobs to this entity.
Definition: Entity.h:731
cEntity::GetAirLevel
int GetAirLevel(void) const
Gets remaining air of a monster.
Definition: Entity.h:507
cEntity::TickBurning
virtual void TickBurning(cChunk &a_Chunk)
Updates the state related to this entity being on fire.
Definition: Entity.cpp:1250
cEntity::GetLastSentPosition
Vector3d GetLastSentPosition(void) const
Returns the last position we sent to all the clients.
Definition: Entity.h:304
cEntity::GetOffHandEquipedItem
virtual cItem GetOffHandEquipedItem(void) const
Returns the currently offhand equipped item; empty item if none.
Definition: Entity.h:348
cEntity::m_Width
float m_Width
Width of the entity, in the XZ plane.
Definition: Entity.h:719
cBoundingBox
Represents two sets of coords, minimum and maximum for each direction.
Definition: BoundingBox.h:23
cEntity::m_AirLevel
int m_AirLevel
Air level of a mobile.
Definition: Entity.h:660
cEntity::GetPosY
double GetPosY(void) const
Definition: Entity.h:196
cEntity::SetPosX
void SetPosX(double a_PosX)
Definition: Entity.h:215
OwnedEntity
std::unique_ptr< cEntity > OwnedEntity
Definition: ChunkDef.h:32
cEntity::DetectPortal
virtual bool DetectPortal(void)
Detects whether we are in a portal block and begins teleportation procedures if so Returns true if Mo...
Definition: Entity.cpp:1420
cEntity::GetEquippedWeapon
virtual cItem GetEquippedWeapon(void) const
Returns the curently equipped weapon; empty item if none.
Definition: Entity.h:333
cEntity::OnAcquireSpectator
void OnAcquireSpectator(cPlayer &a_Player)
Called when a player begins spectating this entity.
Definition: Entity.cpp:138
cEntity::m_bHasSentNoSpeed
bool m_bHasSentNoSpeed
Stores whether we have sent a Velocity packet with a speed of zero (no speed) to the client Ensures t...
Definition: Entity.h:601
TakeDamageInfo::RawDamage
int RawDamage
Definition: Entity.h:63
cEntity::GetEquippedChestplate
virtual cItem GetEquippedChestplate(void) const
Returns the currently equipped chestplate; empty item if none.
Definition: Entity.h:339
cEntity::AddSpeedZ
void AddSpeedZ(double a_AddSpeedZ)
Definition: Entity.cpp:2221
cEntity::m_Speed
Vector3d m_Speed
Measured in meters / second (m / s)
Definition: Entity.h:577
cEntity::SetSpeed
void SetSpeed(Vector3d a_Speed)
Sets the speed of the entity, measured in m / sec.
Definition: Entity.h:228
cEntity::GetWorld
cWorld * GetWorld(void) const
Definition: Entity.h:190
cEntity::SetIsTicking
void SetIsTicking(bool a_IsTicking)
Set the entity's status to either ticking or not ticking.
Definition: Entity.cpp:1777
cEntity::WrapRotation
void WrapRotation()
Makes sure rotation is not over the specified range.
Definition: Entity.cpp:213
cEntity::m_Health
float m_Health
Definition: Entity.h:584
cEntity::Initialize
bool Initialize(OwnedEntity a_Self, cWorld &a_EntityWorld)
Spawns the entity in the world; returns true if spawned, false if not (plugin disallowed).
Definition: Entity.cpp:111
cEntity::sWorldChangeInfo::m_NewWorld
cWorld * m_NewWorld
Definition: Entity.h:81
cEntity::AddLeashedMob
void AddLeashedMob(cMonster *a_Monster)
Adds a mob to the leashed list of mobs.
Definition: Entity.cpp:2299
cEntity::GetPosX
double GetPosX(void) const
Definition: Entity.h:195
cEntity::AddPosX
void AddPosX(double a_AddPosX)
Definition: Entity.h:239
cEntity::SetSpeedX
void SetSpeedX(double a_SpeedX)
Sets the speed in the X axis, leaving the other speed components intact.
Definition: Entity.cpp:2167
cEntity::etExpOrb
@ etExpOrb
Definition: Entity.h:100
cEntity::m_MaxHealth
float m_MaxHealth
Definition: Entity.h:585
cEntity::GetPosZ
double GetPosZ(void) const
Definition: Entity.h:197
cEntity::IsOnGround
virtual bool IsOnGround(void) const
Returns whether the entity is on ground or not.
Definition: Entity.h:519
cEntity::cEntity
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
Definition: Entity.cpp:37
cEntity::m_EntityType
eEntityType m_EntityType
Definition: Entity.h:622
cEntity::m_Attachee
cEntity * m_Attachee
The entity which is attached to this entity (rider), nullptr if none.
Definition: Entity.h:591
cEntity::IsInvisible
virtual bool IsInvisible(void) const
Definition: Entity.h:488
UInt32
unsigned int UInt32
Definition: Globals.h:154
cEntity::m_HeadYaw
double m_HeadYaw
Measured in degrees, [-180, +180)
Definition: Entity.h:704
cEntity::IsEnderCrystal
bool IsEnderCrystal(void) const
Definition: Entity.h:159
cEntity::m_InvulnerableTicks
int m_InvulnerableTicks
If a player hit a entity, the entity receive a invulnerable of 10 ticks.
Definition: Entity.h:726
cEntity::IsCrouched
virtual bool IsCrouched(void) const
Definition: Entity.h:486
cEntity::GetMass
double GetMass(void) const
Definition: Entity.h:194
cEntity::TeleportToEntity
virtual void TeleportToEntity(cEntity &a_Entity)
Teleports to the entity specified.
Definition: Entity.cpp:1943
cEntity::Detach
void Detach(void)
Detaches from the currently attached entity, if any.
Definition: Entity.cpp:2052
cEntity::IsDestroyed
bool IsDestroyed() const
Deprecated.
Definition: Entity.h:256
cEntity::IsHeadInWater
virtual bool IsHeadInWater(void) const
Returns true if any part of the entity is in a water block.
Definition: Entity.h:504
cEntity::eEntityType
eEntityType
Definition: Entity.h:88
cEntity::etMonster
@ etMonster
Definition: Entity.h:94
cEntity::GetInvulnerableTicks
int GetInvulnerableTicks(void) const
Gets the invulnerable ticks from the entity.
Definition: Entity.h:513
cEntity::AddSpeedX
void AddSpeedX(double a_AddSpeedX)
Definition: Entity.cpp:2203
cEntity::GetHeight
float GetHeight(void) const
Definition: Entity.h:193
cEntity::m_IsFireproof
bool m_IsFireproof
Whether the entity is capable of taking fire or lava damage.
Definition: Entity.h:630
cEntity::m_TicksLeftBurning
int m_TicksLeftBurning
Time, in ticks, until the entity extinguishes its fire.
Definition: Entity.h:642
cEntity::SetMass
void SetMass(double a_Mass)
Definition: Entity.cpp:2113
cEntity::GetEquippedHelmet
virtual cItem GetEquippedHelmet(void) const
Returns the currently equipped helmet; empty item if none.
Definition: Entity.h:336
cEntity::SetHeadYaw
void SetHeadYaw(double a_HeadYaw)
Definition: Entity.cpp:2102
cEntity::GetLookVector
Vector3d GetLookVector(void) const
Definition: Entity.cpp:2267
Vector3::z
T z
Definition: Vector3.h:17
cEntity::etPainting
@ etPainting
Definition: Entity.h:103
cEntity::m_AirDrag
float m_AirDrag
Stores the air drag that is applied to the entity every tick, measured in speed ratio per tick Acts a...
Definition: Entity.h:614
cEntity::IsInWater
virtual bool IsInWater(void) const
Returns true if any part of the entity is in a water block.
Definition: Entity.h:501
cEntity::ApplyFriction
static void ApplyFriction(Vector3d &a_Speed, double a_SlowdownMultiplier, float a_Dt)
Applies friction to an entity.
Definition: Entity.cpp:1229
cEntity::ArmorCoversAgainst
virtual bool ArmorCoversAgainst(eDamageType a_DamageType)
Returns whether armor will protect against the specified damage type.
Definition: Entity.cpp:660
cEntity::IsFloater
bool IsFloater(void) const
Definition: Entity.h:170
cEntity::MoveToWorld
bool MoveToWorld(cWorld &a_World, bool a_ShouldSendRespawn, Vector3d a_NewPosition)
Definition: Entity.h:436
cEntity::etEntity
@ etEntity
Definition: Entity.h:90
cEntity::GetTicksAlive
long int GetTicksAlive(void) const
Gets number of ticks this entity has been alive for.
Definition: Entity.h:510
cEntity::DoesPreventBlockPlacement
virtual bool DoesPreventBlockPlacement(void) const
Returns whether blocks can be placed intersecting this entities' hitbox.
Definition: Entity.h:188
cEntity::OnStartedBurning
virtual void OnStartedBurning(void)
Called when the entity starts burning.
Definition: Entity.cpp:1866
cEntity::GetArmorCoverAgainst
virtual float GetArmorCoverAgainst(const cEntity *a_Attacker, eDamageType a_DamageType, int a_RawDamage)
Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover.
Definition: Entity.cpp:768
cEntity::LAVA_DAMAGE
static const int LAVA_DAMAGE
Damage to deal when standing in lava.
Definition: Entity.h:115
cEntity::m_TicksSinceLastBurnDamage
int m_TicksSinceLastBurnDamage
Time, in ticks, since the last damage dealt by being on fire.
Definition: Entity.h:633
cEntity::etTNT
@ etTNT
Definition: Entity.h:98
cEntity::m_IsInWater
bool m_IsInWater
If any part of the entity is in a water block.
Definition: Entity.h:654
cEntity::OnRemoveFromWorld
virtual void OnRemoveFromWorld(cWorld &a_World)
Called when the entity is removed from a world.
Definition: Entity.cpp:172
cEntity::IsInLava
virtual bool IsInLava(void) const
Returns true if any part of the entity is in a lava block.
Definition: Entity.h:498
cEntity::BURN_TICKS
static const int BURN_TICKS
Ticks to keep an entity burning after it has stood in lava / fire.
Definition: Entity.h:119
cEntity::ApplyArmorDamage
virtual void ApplyArmorDamage(int DamageBlocked)
Applies damage to the armor after the armor blocked the given amount.
Definition: Entity.cpp:651
cEntity::IsProjectile
bool IsProjectile(void) const
Definition: Entity.h:168
cWorld
Definition: World.h:47
cEntity::SetSwimState
virtual void SetSwimState(cChunk &a_Chunk)
Called once per tick to set m_IsInFire, m_IsInLava, m_IsInWater and m_IsHeadInWater.
Definition: Entity.cpp:1701
cEntity::KilledBy
virtual void KilledBy(TakeDamageInfo &a_TDI)
Called when the health drops below zero.
Definition: Entity.cpp:850
cEntity::IsPawn
bool IsPawn(void) const
Definition: Entity.h:163
cEntity::GetAttached
cEntity * GetAttached()
Gets entity (vehicle) attached to this entity.
Definition: Entity.cpp:2018
cEntity::GetChunkZ
int GetChunkZ(void) const
Definition: Entity.h:208
cEntity::GetSpeedX
double GetSpeedX(void) const
Definition: Entity.h:202
cEntity::sPortalCooldownData
Structure storing the portal delay timer and cooldown boolean.
Definition: Entity.h:565
cEntity::SetYawFromSpeed
void SetYawFromSpeed(void)
Sets the rotation to match the speed vector (entity goes "face-forward")
Definition: Entity.cpp:371
cEntity::GetHealth
float GetHealth(void) const
Returns the health of this entity.
Definition: Entity.h:367
cEntity::GetChunkX
int GetChunkX(void) const
Definition: Entity.h:207
cEntity::IsOnFire
virtual bool IsOnFire(void) const
Definition: Entity.h:489
cEntity::m_World
cWorld * m_World
Definition: Entity.h:624
cEntity::HandleAir
virtual void HandleAir(void)
Called in each tick to handle air-related processing i.e.
Definition: Entity.cpp:1797
cEntity::StartBurning
void StartBurning(int a_TicksLeftBurning)
Puts the entity on fire for the specified amount of ticks.
Definition: Entity.cpp:1907
cEntity::GetHeadYaw
double GetHeadYaw(void) const
Definition: Entity.h:192
cEntity::LAVA_TICKS_PER_DAMAGE
static const int LAVA_TICKS_PER_DAMAGE
Ticks to wait between damaging an entity when it stands in lava.
Definition: Entity.h:114
cEntity::FIRE_TICKS_PER_DAMAGE
static const int FIRE_TICKS_PER_DAMAGE
Ticks to wait between damaging an entity when it stands in fire.
Definition: Entity.h:112
cMonster
Definition: Monster.h:16
cItem
Definition: Item.h:36
cEntity::SetAirDrag
void SetAirDrag(float a_AirDrag)
Definition: Entity.h:286
cEntity::MoveToWorld
bool MoveToWorld(cWorld &a_World, Vector3d a_NewPosition, bool a_ShouldSetPortalCooldown=false, bool a_ShouldSendRespawn=true)
Definition: Entity.cpp:1615
cEntity::GetSpeedY
double GetSpeedY(void) const
Definition: Entity.h:203
cEntity::DoMoveToWorld
void DoMoveToWorld(const sWorldChangeInfo &a_WorldChangeInfo)
Handles the moving of this entity between worlds.
Definition: Entity.cpp:1572
Vector3d
Vector3< double > Vector3d
Definition: Vector3.h:485
cEntity::SetPitch
void SetPitch(double a_Pitch)
Definition: Entity.cpp:2136
cEntity::m_IsTicking
bool m_IsTicking
Whether the entity is ticking or not.
Definition: Entity.h:698
cEntity::IsMob
bool IsMob(void) const
Definition: Entity.h:162
cEntity::GetAirDrag
float GetAirDrag(void) const
Definition: Entity.h:284
cEntity::m_bOnGround
bool m_bOnGround
Stores if the entity is on the ground.
Definition: Entity.h:604
cEntity::m_TicksSinceLastVoidDamage
int m_TicksSinceLastVoidDamage
Time, in ticks, since the last damage dealt by the void.
Definition: Entity.h:645
cEntity::SetRoll
void SetRoll(double a_Roll)
Definition: Entity.cpp:2147
cEntity::GetGravity
float GetGravity(void) const
Definition: Entity.h:280
cEntity::GetRoll
double GetRoll(void) const
Definition: Entity.h:200
cEntity::sWorldChangeInfo::m_NewPosition
Vector3d m_NewPosition
Definition: Entity.h:82
cEntity::OnRightClicked
virtual void OnRightClicked(cPlayer &a_Player)
Called when the specified player right-clicks this entity.
Definition: Entity.h:524
TakeDamageInfo::Knockback
Vector3d Knockback
Definition: Entity.h:65
cEntity::sWorldChangeInfo::m_SetPortalCooldown
bool m_SetPortalCooldown
Definition: Entity.h:83
cEntity::AddPosition
void AddPosition(const Vector3d &a_AddPos)
Definition: Entity.h:243
cEntity::SetSpeedY
void SetSpeedY(double a_SpeedY)
Sets the speed in the Y axis, leaving the other speed components intact.
Definition: Entity.cpp:2176
cEntity::etFloater
@ etFloater
Definition: Entity.h:101
cEntity::IsFireproof
virtual bool IsFireproof(void) const
Definition: Entity.h:412
cEntity::SetInvulnerableTicks
void SetInvulnerableTicks(int a_InvulnerableTicks)
Set the invulnerable ticks from the entity.
Definition: Entity.h:516
cItems
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:213
cEntity::DoTakeDamage
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI)
Makes this entity take damage specified in the a_TDI.
Definition: Entity.cpp:404
cEntity::m_Mass
double m_Mass
Measured in Kilograms (Kg)
Definition: Entity.h:716
cEntity::m_Height
float m_Height
Height of the entity (Y axis).
Definition: Entity.h:722
cEntity::INVALID_ID
static const UInt32 INVALID_ID
Special ID that is considered an "invalid value", signifying no entity.
Definition: Entity.h:128
cEntity::AttachTo
void AttachTo(cEntity &a_AttachTo)
Attaches to the specified entity; detaches from any previous one first.
Definition: Entity.cpp:2027
cEntity::etBoat
@ etBoat
Definition: Entity.h:97
cEntity::GetKnockbackAmountAgainst
virtual double GetKnockbackAmountAgainst(const cEntity &a_Receiver)
Returns the knockback amount that the currently equipped items would cause to a_Receiver on a hit.
Definition: Entity.cpp:826
cEntity::TickInVoid
virtual void TickInVoid(cChunk &a_Chunk)
Handles when the entity is in the void.
Definition: Entity.cpp:1345
cEntity::OnFinishedBurning
virtual void OnFinishedBurning(void)
Called when the entity finishes burning.
Definition: Entity.cpp:1876
cEntity::BroadcastDeathMessage
void BroadcastDeathMessage(TakeDamageInfo &a_TDI)
Announces a death message on chat about killing the entity.
Definition: Entity.cpp:2349
cEntity::SetPitchFromSpeed
void SetPitchFromSpeed(void)
Sets the pitch to match the speed vector (entity gies "face-forward")
Definition: Entity.cpp:387
cEntity::BroadcastMovementUpdate
virtual void BroadcastMovementUpdate(const cClientHandle *a_Exclude=nullptr)
Updates clients of changes in the entity.
Definition: Entity.cpp:1965
cEntity::Heal
virtual void Heal(int a_HitPoints)
Heals the specified amount of HPs.
Definition: Entity.cpp:889
cEntity::IsAttachedTo
bool IsAttachedTo(const cEntity *a_Entity) const
Returns true if this entity is attached to the specified entity.
Definition: Entity.cpp:2081
cEntity::IsBoat
bool IsBoat(void) const
Definition: Entity.h:166
cEntity::Tick
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk)
Definition: Entity.cpp:908
cEntity::etEnderCrystal
@ etEnderCrystal
Definition: Entity.h:91
cEntity::m_TicksSinceLastLavaDamage
int m_TicksSinceLastLavaDamage
Time, in ticks, since the last damage dealt by standing in lava.
Definition: Entity.h:636
cEntity::SetIsFireproof
void SetIsFireproof(bool a_IsFireproof)
Sets whether the entity is fireproof.
Definition: Entity.cpp:1898
cEntity::m_UniqueID
UInt32 m_UniqueID
The ID of the entity that is guaranteed to be unique within a single run of the server.
Definition: Entity.h:582
cEntity::m_WorldChangeInfo
sWorldChangeInfo m_WorldChangeInfo
If field m_NewWorld not nullptr, a world change is scheduled and a task is queued in the current worl...
Definition: Entity.h:627
cEntity::IsItemFrame
bool IsItemFrame(void) const
Definition: Entity.h:171
cEntity::IsTicking
bool IsTicking(void) const
Returns true if the entity is valid and ticking.
Definition: Entity.cpp:2259
cEntity::SetParentChunk
void SetParentChunk(cChunk *a_Chunk)
Sets the parent chunk, which is the chunk responsible for ticking this entity.
Definition: Entity.cpp:234
cEntity::SpawnOn
virtual void SpawnOn(cClientHandle &a_Client)=0
Descendants override this function to send a command to the specified client to spawn the entity on t...
cChunk
Definition: Chunk.h:35
cEntity::GetClassStatic
static const char * GetClassStatic(void)
Returns the class name of this class.
Definition: Entity.cpp:93
cEntity::m_Position
Vector3d m_Position
Position of the entity's XZ center and Y bottom.
Definition: Entity.h:710
cEntity::SetYaw
void SetYaw(double a_Yaw)
Definition: Entity.cpp:2125
cEntity::m_IsHeadInWater
bool m_IsHeadInWater
If the entity's head is in a water block.
Definition: Entity.h:657
TakeDamageInfo::Attacker
cEntity * Attacker
Definition: Entity.h:62
cEntity::GetEquippedBoots
virtual cItem GetEquippedBoots(void) const
Returns the currently equipped boots; empty item if none.
Definition: Entity.h:345
cEntity::GetSpeedZ
double GetSpeedZ(void) const
Definition: Entity.h:204
cEntity::Killed
virtual void Killed(const cEntity &a_Victim, eDamageType a_DamageType)
Called when the entity kills another entity.
Definition: Entity.h:361
cEntity::GetSpeed
const Vector3d & GetSpeed(void) const
Exported in ManualBindings.
Definition: Entity.h:300
cEntity::BURN_TICKS_PER_DAMAGE
static const int BURN_TICKS_PER_DAMAGE
Ticks to wait between damaging an entity when it is burning.
Definition: Entity.h:116
cEntity::IsInFire
virtual bool IsInFire(void) const
Returns true if any part of the entity is in a fire block.
Definition: Entity.h:495
cEntity::FALL_DAMAGE_HEIGHT
static const int FALL_DAMAGE_HEIGHT
Y difference after which fall damage is applied.
Definition: Entity.h:125
cEntity
Definition: Entity.h:75
cEntity::GetPitch
double GetPitch(void) const
Definition: Entity.h:199
cEntity::GetParentClass
virtual const char * GetParentClass(void) const
Returns the topmost class's parent class name for the object.
Definition: Entity.cpp:102
cPlayer
Definition: Player.h:27
cEntity::etMinecart
@ etMinecart
Definition: Entity.h:96
cEntity::AddSpeed
void AddSpeed(const Vector3d &a_AddSpeed)
Definition: Entity.h:245
cEntity::HandlePhysics
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk &a_Chunk)
Handles the physics of the entity - updates position based on speed, updates speed based on environme...
Definition: Entity.cpp:1000
cEntity::GetEnchantmentBlastKnockbackReduction
virtual float GetEnchantmentBlastKnockbackReduction()
Returns explosion knock back reduction percent from blast protection level.
Definition: Entity.cpp:743
cEntity::SetPosZ
void SetPosZ(double a_PosZ)
Definition: Entity.h:217
cEntity::BURN_DAMAGE
static const int BURN_DAMAGE
Damage to deal when the entity is burning.
Definition: Entity.h:117
cEntity::AddSpeed
void AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ)
Definition: Entity.cpp:2194
cEntity::GetMaxHealth
float GetMaxHealth(void) const
Definition: Entity.h:407
cEntity::WrapHeadYaw
void WrapHeadYaw()
Makes sure head yaw is not over the specified range.
Definition: Entity.cpp:204
cEntity::IsPickup
bool IsPickup(void) const
Definition: Entity.h:161
UNUSED
#define UNUSED
Definition: Globals.h:72
cEntity::~cEntity
virtual ~cEntity()=default
cEntity::GetPosition
const Vector3d & GetPosition(void) const
Exported in ManualBindings.
Definition: Entity.h:297
eDamageType
eDamageType
Damage type, used in the TakeDamageInfo structure and related functions.
Definition: Defines.h:243
cEntity::Destroy
void Destroy()
Destroys the entity, schedules it for memory freeing and broadcasts the DestroyEntity packet.
Definition: Entity.cpp:243
Vector3::y
T y
Definition: Vector3.h:17
cEntity::GetEquippedLeggings
virtual cItem GetEquippedLeggings(void) const
Returns the currently equipped leggings; empty item if none.
Definition: Entity.h:342
cEntity::etItemFrame
@ etItemFrame
Definition: Entity.h:102
cEntity::IsFallingBlock
bool IsFallingBlock(void) const
Definition: Entity.h:164
cEntity::IsRiding
virtual bool IsRiding(void) const
Definition: Entity.h:491
cEntity::m_IsInLava
bool m_IsInLava
If any part of the entity is in a lava block.
Definition: Entity.h:651
cEntity::SetSize
void SetSize(float a_Width, float a_Height)
Update an entity's size, for example, on body stance changes.
Definition: Entity.cpp:1787
cEntity::IsWorldChangeScheduled
bool IsWorldChangeScheduled() const
Returns true if a world change is scheduled to happen.
Definition: Entity.h:450
cEntity::m_WaterSpeed
Vector3d m_WaterSpeed
Measured in meter / second.
Definition: Entity.h:713
cEntity::GetDrops
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr)
Returns the list of drops for this pawn when it is killed.
Definition: Entity.h:527
cEntity::IsMinecart
bool IsMinecart(void) const
Definition: Entity.h:165
cEntity::m_bDirtyHead
bool m_bDirtyHead
Stores whether head yaw has been set manually.
Definition: Entity.h:594
cEntity::SetPosition
void SetPosition(double a_PosX, double a_PosY, double a_PosZ)
Definition: Entity.h:218
cEntity::m_Rot
Vector3d m_Rot
Measured in degrees, [-180, +180)
Definition: Entity.h:707
cEntity::OnLoseSpectator
void OnLoseSpectator(cPlayer &a_Player)
Called when a player stops spectating this entity.
Definition: Entity.cpp:159
cEntity::m_AirTickTimer
int m_AirTickTimer
Definition: Entity.h:661
AString
std::string AString
Definition: StringUtils.h:11
Vector3< double >
cEntity::etPickup
@ etPickup
Definition: Entity.h:93
cEntity::m_LastSentPosition
Vector3d m_LastSentPosition
Last position sent to client via the Relative Move or Teleport packets (not Velocity) Only updated if...
Definition: Entity.h:618
cEntity::GetWidth
float GetWidth(void) const
Definition: Entity.h:205
TakeDamageInfo
Definition: Entity.h:59
cEntity::HasAnyMobLeashed
bool HasAnyMobLeashed() const
Returs whether the entity has any mob leashed to it.
Definition: Entity.h:557
cEntity::GetBoundingBox
cBoundingBox GetBoundingBox() const
Definition: Entity.h:211
cEntity::BroadcastLeashedMobs
void BroadcastLeashedMobs()
If has any mobs are leashed, broadcasts every leashed entity to this.
Definition: Entity.cpp:2325
cEntity::m_Gravity
float m_Gravity
Stores gravity that is applied to an entity every tick For realistic effects, this should be negative...
Definition: Entity.h:608
cEntity::AddPosZ
void AddPosZ(double a_AddPosZ)
Definition: Entity.h:241
cEntity::ResetPosition
virtual void ResetPosition(Vector3d a_NewPos)
Set the entities position and last sent position.
Definition: Entity.cpp:1856
cEntity::IsA
virtual bool IsA(const char *a_ClassName) const
Returns true if the entity is of the specified class or a subclass (cPawn's IsA("cEntity") returns tr...
Definition: Entity.cpp:2072
cEntity::GetClass
virtual const char * GetClass(void) const
Returns the topmost class name for the object.
Definition: Entity.cpp:84
cEntity::IsLeashKnot
bool IsLeashKnot(void) const
Definition: Entity.h:172
cEntity::WrapSpeed
void WrapSpeed()
Makes speed is not over 20.
Definition: Entity.cpp:223
cEntity::IsElytraFlying
virtual bool IsElytraFlying(void) const
Definition: Entity.h:487
cEntity::SetGravity
void SetGravity(float a_Gravity)
Definition: Entity.h:282
cEntity::OnDetach
virtual void OnDetach()
Called when this entity dismounts from m_AttachedTo.
Definition: Entity.cpp:2341
cEntity::m_LastPosition
Vector3d m_LastPosition
Definition: Entity.h:620
cEntity::IsTNT
bool IsTNT(void) const
Definition: Entity.h:167
cEntity::DROWNING_TICKS
static const int DROWNING_TICKS
Number of ticks per heart of damage.
Definition: Entity.h:122
cEntity::GetEnchantmentCoverAgainst
virtual float GetEnchantmentCoverAgainst(const cEntity *a_Attacker, eDamageType a_DamageType, int a_Damage)
Returns the hitpoints that the currently equipped armor's enchantments would cover.
Definition: Entity.cpp:700
cEntity::etProjectile
@ etProjectile
Definition: Entity.h:99
cEntity::AddPosition
void AddPosition(double a_AddPosX, double a_AddPosY, double a_AddPosZ)
Definition: Entity.h:242
cEntity::SetMaxHealth
void SetMaxHealth(float a_MaxHealth)
Sets the maximum value for the health.
Definition: Entity.cpp:1886
cEntity::RemoveLeashedMob
void RemoveLeashedMob(cMonster *a_Monster)
Removes a mob from the leashed list of mobs.
Definition: Entity.cpp:2311
cEntity::GetYaw
double GetYaw(void) const
Definition: Entity.h:198
cEntity::StopBurning
void StopBurning(void)
Stops the entity from burning, resets all burning timers.
Definition: Entity.cpp:1924
cEntity::IsPainting
bool IsPainting(void) const
Definition: Entity.h:173
cEntity::DetectMagma
virtual void DetectMagma(void)
Detects the time for application of magma block damage.
Definition: Entity.cpp:1391
cEntity::IsRclking
virtual bool IsRclking(void) const
Definition: Entity.h:490