4 #include "../BlockInfo.h"
6 #include "../ClientHandle.h"
7 #include "../Simulator/SandSimulator.h"
15 Super(etFallingBlock, a_Position, 0.98f, 0.98f),
16 m_BlockType(a_BlockType),
17 m_BlockMeta(a_BlockMeta)
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()))
bool IsBlockWater(BLOCKTYPE a_BlockType)
@ E_BLOCK_CONCRETE_POWDER
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
void SendSpawnEntity(const cEntity &a_Entity)
const Vector3d & GetSpeed(void) const
Exported in ManualBindings.
double GetSpeedZ(void) const
static const int VOID_BOUNDARY
Y position to begin applying void damage.
void SetGravity(float a_Gravity)
void Destroy()
Destroys the entity, schedules it for memory freeing and broadcasts the DestroyEntity packet.
void AddSpeedY(double a_AddSpeedY)
double GetPosY(void) const
void AddPosition(double a_AddPosX, double a_AddPosY, double a_AddPosZ)
void SetAirDrag(float a_AirDrag)
virtual void BroadcastMovementUpdate(const cClientHandle *a_Exclude=nullptr)
Updates clients of changes in the entity.
double GetSpeedX(void) const
cFallingBlock(Vector3d a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Creates a new falling block.
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 Tick(std::chrono::milliseconds a_Dt, cChunk &a_Chunk) override
static bool CanContinueFallThrough(BLOCKTYPE a_BlockType)
Returns true if an already-falling block can pass through the specified block type (e.
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,...
static bool DoesBreakFallingThrough(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Returns true if the specified block breaks falling blocks while they fall through it (e.