summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/EnderChestEntity.cpp
diff options
context:
space:
mode:
authorNounours Heureux <schtroumps31@gmail.com>2015-07-06 18:39:02 +0200
committerMattes D <github@xoft.cz>2015-07-07 12:29:52 +0200
commit91833b7cb8f40de0e5f938ccbae64e56d2358ec7 (patch)
treea8c9ae2d453816996b3a6e13397a0f1540bc81af /src/BlockEntities/EnderChestEntity.cpp
parentFixed warnings generated by 64-bit MSVC. (diff)
downloadcuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar.gz
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar.bz2
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar.lz
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar.xz
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.tar.zst
cuberite-91833b7cb8f40de0e5f938ccbae64e56d2358ec7.zip
Diffstat (limited to 'src/BlockEntities/EnderChestEntity.cpp')
-rw-r--r--src/BlockEntities/EnderChestEntity.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp
index ab5c5a2de..00e203520 100644
--- a/src/BlockEntities/EnderChestEntity.cpp
+++ b/src/BlockEntities/EnderChestEntity.cpp
@@ -35,6 +35,12 @@ cEnderChestEntity::~cEnderChestEntity()
void cEnderChestEntity::UsedBy(cPlayer * a_Player)
{
+ // TODO: cats are an obstruction
+ if ((GetPosY() < cChunkDef::Height - 1) && !cBlockInfo::IsTransparent(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())))
+ {
+ // Obstruction, don't open
+ return;
+ }
// If the window is not created, open it anew:
cWindow * Window = GetWindow();
if (Window == nullptr)
@@ -42,7 +48,7 @@ void cEnderChestEntity::UsedBy(cPlayer * a_Player)
OpenNewWindow();
Window = GetWindow();
}
-
+
// Open the window for the player:
if (Window != nullptr)
{
@@ -91,7 +97,3 @@ void cEnderChestEntity::SaveToJson(Json::Value & a_Value, const cItemGrid & a_Gr
a_Value.append(Slot);
}
}
-
-
-
-