summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-12 01:15:21 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-12 01:15:21 +0200
commit85ec697d32c3e5a4b2e711c25c6f836a0a948419 (patch)
treee7d20ae52c8c70fec45fb0f3fc52568a79f937f1 /src/Protocol/Protocol18x.cpp
parent1.8: Enderman, byte -> short (diff)
downloadcuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar.gz
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar.bz2
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar.lz
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar.xz
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.tar.zst
cuberite-85ec697d32c3e5a4b2e711c25c6f836a0a948419.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol18x.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 154da212c..ba39bb3e6 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -1506,18 +1506,34 @@ void cProtocol180::SendWindowClose(const cWindow & a_Window)
void cProtocol180::SendWindowOpen(const cWindow & a_Window)
{
ASSERT(m_State == 3); // In game mode?
-
+
if (a_Window.GetWindowType() < 0)
{
// Do not send this packet for player inventory windows
return;
}
-
+
cPacketizer Pkt(*this, 0x2d);
Pkt.WriteChar(a_Window.GetWindowID());
Pkt.WriteString(a_Window.GetWindowTypeName());
Pkt.WriteString(Printf("{\"text\":\"%s\"}", a_Window.GetWindowTitle().c_str()));
- Pkt.WriteChar(a_Window.GetNumNonInventorySlots());
+
+ switch (a_Window.GetWindowType())
+ {
+ case cWindow::wtWorkbench:
+ case cWindow::wtEnchantment:
+ case cWindow::wtAnvil:
+ {
+ Pkt.WriteChar(0);
+ break;
+ }
+ default:
+ {
+ Pkt.WriteChar(a_Window.GetNumNonInventorySlots());
+ break;
+ }
+ }
+
if (a_Window.GetWindowType() == cWindow::wtAnimalChest)
{
Pkt.WriteInt(0); // TODO: The animal's EntityID