71 double a_PosX,
double a_PosY,
double a_PosZ,
76 return Create(a_Kind, a_Creator, {a_PosX, a_PosY, a_PosZ}, a_Item, a_Speed);
143 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
CreatorData(UInt32 a_UniqueID, const AString &a_Name, const cEnchantments &a_Enchantments)
CreatorData m_CreatorData
The structure for containing the entity ID and name who has created this projectile The ID and / or n...
AString GetMCAClassName(void) const
Returns the string that is used as the entity type (class name) in MCA files.
eKind GetProjectileKind(void) const
Returns the kind of the projectile (fast class identification)
AString GetCreatorName(void) const
Returns the name of the player that created the projectile Will be empty for non-player creators...
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
eKind
The kind of the projectile.
virtual void OnHitSolidBlock(Vector3d a_HitPos, eBlockFace a_HitFace)
Called by the physics blocktracer when the entity hits a solid block, the hit position and the face h...
static std::unique_ptr< cProjectileEntity > Create(eKind a_Kind, cEntity *a_Creator, Vector3d a_Pos, const cItem *a_Item, const Vector3d *a_Speed=nullptr)
Creates a new instance of the specified projectile entity.
void SetIsInGround(bool a_IsInGround)
Sets the internal InGround flag.
cEnchantments m_Enchantments
virtual void SpawnOn(cClientHandle &a_Client) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
virtual void CollectedBy(cPlayer &a_Dest)
Called by Chunk when the projectile is eligible for player collection.
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
bool IsInGround(void) const
Returns true if the projectile has hit the ground and is stuck there.
A structure that stores the Entity ID and Playername of the projectile's creator Used to migitate inv...
bool m_IsInGround
True if the projectile has hit the ground and is stuck there.
cEntity(eEntityType a_EntityType, Vector3d a_Pos, double a_Width, double a_Height)
eKind m_ProjectileKind
The type of projectile I am.
virtual void HandlePhysics(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
Handles the physics of the entity - updates position based on speed, updates speed based on environme...
virtual void OnHitEntity(cEntity &a_EntityHit, Vector3d a_HitPos)
Called by the physics blocktracer when the entity hits another entity.
UInt32 GetCreatorUniqueID(void)
Returns the unique ID of the entity who created this projectile May return an ID <0.
#define CLASS_PROTODEF(classname)
Class that stores item enchantments or stored-enchantments The enchantments may be serialized to a st...