2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Entity.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-09 08:24:41 -04:00
|
|
|
// tolua_begin
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
class cFallingBlock :
|
|
|
|
public cEntity
|
|
|
|
{
|
|
|
|
typedef cEntity super;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
public:
|
2017-05-09 08:24:41 -04:00
|
|
|
// tolua_end
|
|
|
|
|
2014-07-22 18:36:13 -04:00
|
|
|
CLASS_PROTODEF(cFallingBlock)
|
2013-07-29 07:13:03 -04:00
|
|
|
|
2015-07-31 10:49:10 -04:00
|
|
|
/** Creates a new falling block. a_BlockPosition is expected in world coords */
|
2013-07-29 07:13:03 -04:00
|
|
|
cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
|
|
|
|
2017-05-09 08:24:41 -04:00
|
|
|
// tolua_begin
|
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
|
|
|
|
NIBBLETYPE GetBlockMeta(void) const { return m_BlockMeta; }
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2017-05-09 08:24:41 -04:00
|
|
|
// tolua_end
|
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
// cEntity overrides:
|
|
|
|
virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
|
2015-01-11 16:12:26 -05:00
|
|
|
virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
private:
|
|
|
|
BLOCKTYPE m_BlockType;
|
|
|
|
NIBBLETYPE m_BlockMeta;
|
|
|
|
Vector3i m_OriginalPosition; // Position where the falling block has started, in world coords
|
2017-05-09 08:24:41 -04:00
|
|
|
} ; // tolua_export
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|