diff options
author | Bond-009 <bond.009@outlook.com> | 2017-08-17 16:29:43 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-08-17 16:29:43 +0200 |
commit | 05045860c2002e3c9a79d90290f4d65fdd171141 (patch) | |
tree | 0265750956435f284d5b9c499dbbe5c90231db73 /src/BlockEntities/EnderChestEntity.cpp | |
parent | Add cLuaWindow OnClicked Callback (#3901) (diff) | |
download | cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar.gz cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar.bz2 cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar.lz cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar.xz cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.tar.zst cuberite-05045860c2002e3c9a79d90290f4d65fdd171141.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockEntities/EnderChestEntity.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/BlockEntities/EnderChestEntity.cpp b/src/BlockEntities/EnderChestEntity.cpp index 9030a0172..e475d7022 100644 --- a/src/BlockEntities/EnderChestEntity.cpp +++ b/src/BlockEntities/EnderChestEntity.cpp @@ -7,6 +7,7 @@ #include "../Entities/Player.h" #include "../UI/EnderChestWindow.h" #include "../ClientHandle.h" +#include "../Mobs/Ocelot.h" @@ -48,8 +49,13 @@ void cEnderChestEntity::SendTo(cClientHandle & a_Client) bool cEnderChestEntity::UsedBy(cPlayer * a_Player) { - // TODO: cats are an obstruction - if ((GetPosY() < cChunkDef::Height - 1) && !cBlockInfo::IsTransparent(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ()))) + if ( + (GetPosY() < cChunkDef::Height - 1) && + ( + !cBlockInfo::IsTransparent(GetWorld()->GetBlock(GetPosX(), GetPosY() + 1, GetPosZ())) || + !cOcelot::IsCatSittingOnBlock(GetWorld(), Vector3d(GetPos())) + ) + ) { // Obstruction, don't open return false; |