summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/ChestEntity.h
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-05-28 20:07:38 +0200
committerLukas Pioch <lukas@zgow.de>2017-05-28 20:07:38 +0200
commitf261a03c141399fdf2de958a7431dc48d98dd04e (patch)
treebf3a087bc608b4dc7f4f6d4dcf2bee350051f56e /src/BlockEntities/ChestEntity.h
parentBroadcast mob head changes (diff)
downloadcuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar.gz
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar.bz2
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar.lz
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar.xz
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.tar.zst
cuberite-f261a03c141399fdf2de958a7431dc48d98dd04e.zip
Diffstat (limited to 'src/BlockEntities/ChestEntity.h')
-rw-r--r--src/BlockEntities/ChestEntity.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h
index 9a10cd9a5..dfd5ca0d0 100644
--- a/src/BlockEntities/ChestEntity.h
+++ b/src/BlockEntities/ChestEntity.h
@@ -39,9 +39,17 @@ public:
virtual void SendTo(cClientHandle & a_Client) override;
virtual bool UsedBy(cPlayer * a_Player) override;
- /** Opens a new chest window for this chest.
- Scans for neighbors to open a double chest window, if appropriate. */
- void OpenNewWindow(void);
+ /** Search horizontally adjacent blocks for neighbouring chests and links them together. */
+ void ScanNeighbours();
+
+ /** Opens a new chest window where this is the primary chest and any neighbour is the secondary. */
+ void OpenNewWindow();
+
+ /** Forces any players to close the owned window. */
+ void DestroyWindow();
+
+ /** Returns true if the chest should not be accessible by players. */
+ bool IsBlocked();
/** Gets the number of players who currently have this chest open */
int GetNumberOfPlayers(void) const { return m_NumActivePlayers; }
@@ -54,6 +62,9 @@ private:
/** Number of players who currently have this chest open */
int m_NumActivePlayers;
+ /** Neighbouring chest that links to form a double chest */
+ cChestEntity * m_Neighbour;
+
/** cItemGrid::cListener overrides: */
virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override
{