summaryrefslogtreecommitdiffstats
path: root/source/BlockEntity.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-06 23:21:57 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-06 23:21:57 +0200
commit502935c061ea913180f0a77a7406f5292e697c79 (patch)
treea74e562a772b89db12985d6f1744ae91ff4890d6 /source/BlockEntity.h
parentAdded a tab in the serversettings where you can edit the world.ini of all your worlds. (diff)
downloadcuberite-502935c061ea913180f0a77a7406f5292e697c79.tar
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.gz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.bz2
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.lz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.xz
cuberite-502935c061ea913180f0a77a7406f5292e697c79.tar.zst
cuberite-502935c061ea913180f0a77a7406f5292e697c79.zip
Diffstat (limited to 'source/BlockEntity.h')
-rw-r--r--source/BlockEntity.h49
1 files changed, 28 insertions, 21 deletions
diff --git a/source/BlockEntity.h b/source/BlockEntity.h
index d62f8aa5e..b3273b9c9 100644
--- a/source/BlockEntity.h
+++ b/source/BlockEntity.h
@@ -8,23 +8,12 @@
-#ifndef _WIN32
-#include "BlockID.h"
-#else
-enum ENUM_BLOCK_ID;
-#endif
-
-
-
-
-
namespace Json
{
class Value;
};
class cPlayer;
-class cWorld;
class cPacket;
@@ -34,23 +23,41 @@ class cPacket;
class cBlockEntity
{
protected:
- cBlockEntity(ENUM_BLOCK_ID a_BlockType, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World)
- : m_PosX( a_BlockX )
- , m_PosY( a_BlockY )
- , m_PosZ( a_BlockZ )
- , m_BlockType( a_BlockType )
- , m_World( a_World )
- {}
+ cBlockEntity(BLOCKTYPE a_BlockType, int a_BlockX, int a_BlockY, int a_BlockZ) : // Used when generating
+ m_PosX(a_BlockX),
+ m_PosY(a_BlockY),
+ m_PosZ(a_BlockZ),
+ m_BlockType(a_BlockType),
+ m_World(NULL)
+ {
+ }
+
+
+ cBlockEntity(BLOCKTYPE a_BlockType, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World) :
+ m_PosX(a_BlockX),
+ m_PosY(a_BlockY),
+ m_PosZ(a_BlockZ),
+ m_BlockType(a_BlockType),
+ m_World(a_World)
+ {
+ }
+
public:
- virtual ~cBlockEntity() {};
+ virtual ~cBlockEntity() {}; // force a virtual destructor in all descendants
+
virtual void Destroy(void) {};
+ void SetWorld(cWorld * a_World)
+ {
+ m_World = a_World;
+ }
+
// Position, in absolute block coordinates:
int GetPosX(void) const { return m_PosX; }
int GetPosY(void) const { return m_PosY; }
int GetPosZ(void) const { return m_PosZ; }
- ENUM_BLOCK_ID GetBlockType(void) const { return m_BlockType; }
+ BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
cWorld * GetWorld(void) const {return m_World; }
@@ -71,7 +78,7 @@ protected:
int m_PosY;
int m_PosZ;
- ENUM_BLOCK_ID m_BlockType;
+ BLOCKTYPE m_BlockType;
cWorld * m_World;
};