5 #include "../ClientHandle.h" 6 #include "../Simulator/SandSimulator.h" 14 super(etFallingBlock,
Vector3d(0.5, 0, 0.5) + a_BlockPosition, 0.98, 0.98),
15 m_BlockType(a_BlockType),
16 m_BlockMeta(a_BlockMeta),
17 m_OriginalPosition(a_BlockPosition)
41 int BlockY =
static_cast<int>(
GetPosY() - 0.5);
97 float MilliDt = a_Dt.count() * 0.001f;
102 if ((fabs(
GetSpeedX()) > std::numeric_limits<double>::epsilon()) || (fabs(
GetSpeedZ()) > std::numeric_limits<double>::epsilon()))
double GetPosY(void) const
static const int VOID_BOUNDARY
Y position to begin applying void damage.
bool IsBlockWater(BLOCKTYPE a_BlockType)
static void FinishFalling(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_FallingBlockType, NIBBLETYPE a_FallingBlockMeta)
Called when a block finishes falling at the specified coords, either by insta-fall, or through cFallingBlock entity.
double GetSpeedX(void) const
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
unsigned char BLOCKTYPE
The datatype used by blockdata.
cFallingBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Creates a new falling block.
void SendSpawnFallingBlock(const cFallingBlock &a_FallingBlock)
const Vector3d & GetSpeed(void) const
Exported in ManualBindings.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
double GetSpeedZ(void) const
virtual void Destroy(bool a_ShouldBroadcast=true)
Destroys the entity and schedules it for memory freeing; if a_ShouldBroadcast is set to true...
void AddPosition(double a_AddPosX, double a_AddPosY, double a_AddPosZ)
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
static bool CanContinueFallThrough(BLOCKTYPE a_BlockType)
Returns true if an already-falling block can pass through the specified block type (e...
void SetGravity(float a_Gravity)
void AddSpeedY(double a_AddSpeedY)
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...
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
void SetAirDrag(float a_AirDrag)
static bool DoesBreakFallingThrough(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Returns true if the specified block breaks falling blocks while they fall through it (e...
virtual void BroadcastMovementUpdate(const cClientHandle *a_Exclude=nullptr)
Updates clients of changes in the entity.