14 #include "../UI/WindowOwner.h"
194 virtual void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
224 void Tick(std::chrono::milliseconds a_Dt,
cChunk & a_Chunk)
override;
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
#define CLASS_PROTODEF(classname)
int GetChunkZ(void) const
int GetChunkX(void) const
cEntity(eEntityType a_EntityType, Vector3d a_Pos, float a_Width, float a_Height)
bool IsSolidBlockAtOffset(int a_XOffset, int a_YOffset, int a_ZOffset)
Tests if a solid block is at a specific offset of the minecart position.
void SnapToRail(NIBBLETYPE a_RailMeta)
Snaps a mincecart to a rail's axis, resetting its speed For curved rails, it changes the cart's direc...
virtual void HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt)
Handles activator rails.
cMinecart(ePayload a_Payload, Vector3d a_Pos)
bool TestBlockCollision(NIBBLETYPE a_RailMeta)
Tests if a solid block is in front of a cart, and stops the cart (and returns true) if so; returns fa...
void ApplyAcceleration(Vector3d a_ForwardDirection, double a_Acceleration)
Applies an acceleration to the minecart parallel to a_ForwardDirection but without allowing backward ...
Vector3i m_DetectorRailPosition
int LastDamage(void) const
void HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt)
Handles detector rail activation Activates detector rails when a minecart is on them.
bool IsBlockCollisionAtOffset(Vector3i a_Offset)
virtual bool DoTakeDamage(TakeDamageInfo &TDI) override
Makes this entity take damage specified in the a_TDI.
ePayload
Minecart payload, values correspond to packet subtype.
bool TestEntityCollision(NIBBLETYPE a_RailMeta)
Tests if this mincecart's bounding box is intersecting another entity's bounding box (collision) and ...
bool IsSolidBlockAtPosition(Vector3i a_Offset)
Tests if there is a block at the specified position which is impassable to minecarts.
ePayload GetPayload(void) const
virtual void HandleSpeedFromAttachee(float a_Forward, float a_Sideways) override
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
virtual void KilledBy(TakeDamageInfo &a_TDI) override
Called when the health drops below zero.
void HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
Handles powered rail physics Each tick, speed up or slow down cart, depending on metadata of rail (po...
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...
void HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt)
Handles physics on normal rails For each tick, slow down on flat rails, speed up or slow down on asce...
virtual void OnRemoveFromWorld(cWorld &a_World) override
Called when the entity is removed from a world.
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
cRideableMinecart(Vector3d a_Pos, const cItem &a_Content, int a_ContentHeight)
const cItem & GetContent(void) const
int GetBlockHeight(void) const
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
virtual void OnSlotChanged(cItemGrid *a_Grid, int a_SlotNum) override
Called whenever a slot changes.
virtual void OnRemoveFromWorld(cWorld &a_World) override
Called when the entity is removed from a world.
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
cMinecartWithChest(Vector3d a_Pos)
const cItem & GetSlot(int a_Idx) const
void SetSlot(int a_Idx, const cItem &a_Item)
void SetIsFueled(bool a_IsFueled, int a_FueledTimeLeft=-1)
bool IsFueled(void) const
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
int GetFueledTimeLeft(void) const
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
cMinecartWithFurnace(Vector3d a_Pos)
void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
void HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt) override
Handles activator rails.
cMinecartWithTNT(Vector3d a_Pos)
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
cMinecartWithHopper(Vector3d a_Pos)
virtual void GetDrops(cItems &a_Drops, cEntity *a_Killer=nullptr) override
Returns the list of drops for this pawn when it is killed.
This class bridges a vector of cItem for safe access via Lua.
void SetSlot(int a_X, int a_Y, const cItem &a_Item)
const cItem & GetSlot(int a_X, int a_Y) const
This class is used as a callback for when a slot changes.
void BroadcastWholeWindow(void)
Sends the contents of the whole window to all clients of this window.
cWindow * GetWindow(void) const
Window owner that is associated with an entity (chest minecart etc.)
void MarkChunkDirty(int a_ChunkX, int a_ChunkZ)