From 502935c061ea913180f0a77a7406f5292e697c79 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 6 Apr 2013 21:21:57 +0000 Subject: Mineshafts: Added random loot to generated chests and fixed chest direction git-svn-id: http://mc-server.googlecode.com/svn/trunk@1365 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/BlockEntity.h | 49 ++++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 21 deletions(-) (limited to 'source/BlockEntity.h') 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; }; -- cgit v1.2.3