2012-06-14 06:06:06 -07:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2013-05-25 04:59:13 -07:00
|
|
|
#include "BlockEntityWithItems.h"
|
2013-05-28 12:12:47 -07:00
|
|
|
#include "../UI/WindowOwner.h"
|
2012-06-14 06:06:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Json
|
|
|
|
{
|
|
|
|
class Value;
|
|
|
|
};
|
|
|
|
|
|
|
|
class cClientHandle;
|
|
|
|
class cServer;
|
|
|
|
class cNBTData;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-06-12 05:30:47 -07:00
|
|
|
class cChestEntity : // tolua_export
|
|
|
|
public cBlockEntityWindowOwner,
|
|
|
|
// tolua_begin
|
|
|
|
public cBlockEntityWithItems
|
2013-04-06 14:21:57 -07:00
|
|
|
{
|
2013-05-25 04:59:13 -07:00
|
|
|
typedef cBlockEntityWithItems super;
|
2013-04-06 14:21:57 -07:00
|
|
|
|
2012-06-14 06:06:06 -07:00
|
|
|
public:
|
2013-05-25 04:59:13 -07:00
|
|
|
enum {
|
|
|
|
ContentsHeight = 3,
|
|
|
|
ContentsWidth = 9,
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
/// Constructor used while generating a chunk; sets m_World to NULL
|
|
|
|
cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ);
|
|
|
|
|
2013-04-06 14:21:57 -07:00
|
|
|
// tolua_end
|
|
|
|
|
2013-05-25 04:59:13 -07:00
|
|
|
/// Constructor used for normal operation
|
2012-10-20 14:53:09 -07:00
|
|
|
cChestEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World);
|
2013-04-06 14:21:57 -07:00
|
|
|
|
2012-06-14 06:06:06 -07:00
|
|
|
virtual ~cChestEntity();
|
|
|
|
|
2013-05-25 04:59:13 -07:00
|
|
|
static const char * GetClassStatic(void) { return "cChestEntity"; }
|
2013-02-02 15:55:29 -08:00
|
|
|
|
2013-06-12 23:13:56 -07:00
|
|
|
bool LoadFromJson(const Json::Value & a_Value);
|
2012-10-20 14:53:09 -07:00
|
|
|
|
|
|
|
// cBlockEntity overrides:
|
2013-06-12 23:13:56 -07:00
|
|
|
virtual void SaveToJson(Json::Value & a_Value) override;
|
2012-08-24 00:58:26 -07:00
|
|
|
virtual void SendTo(cClientHandle & a_Client) override;
|
2013-06-12 23:13:56 -07:00
|
|
|
virtual void UsedBy(cPlayer * a_Player) override;
|
2012-10-20 14:53:09 -07:00
|
|
|
|
2013-06-12 23:13:56 -07:00
|
|
|
/// Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate.
|
2012-10-20 14:53:09 -07:00
|
|
|
void OpenNewWindow(void);
|
2013-04-06 14:21:57 -07:00
|
|
|
} ; // tolua_export
|
2012-06-14 06:06:06 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|