summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol17x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-17 20:14:08 +0100
committerTheJumper <maximilian.springer@web.de>2014-02-23 19:50:50 +0100
commitab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2 (patch)
treee4b50b198e8e869a7e8955110a121329ffaf1ac5 /src/Protocol/Protocol17x.cpp
parentMerge pull request #694 from mc-server/itemframes (diff)
downloadcuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar.gz
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar.bz2
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar.lz
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar.xz
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.tar.zst
cuberite-ab2eba17ec36e5d906d0a45e33b8c7d59e19d4e2.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol17x.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 0c569c07c..213e6a1f8 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -28,6 +28,7 @@ Implements the 1.7.x protocol classes:
#include "../Mobs/IncludeAllMonsters.h"
#include "../UI/Window.h"
#include "../BlockEntities/CommandBlockEntity.h"
+#include "../BlockEntities/SkullEntity.h"
#include "../CompositeChat.h"
@@ -1058,6 +1059,7 @@ void cProtocol172::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
case E_BLOCK_MOB_SPAWNER: Action = 1; break; // Update mob spawner spinny mob thing
case E_BLOCK_COMMAND_BLOCK: Action = 2; break; // Update command block text
+ case E_BLOCK_HEAD: Action = 4; break; // Update Skull entity
default: ASSERT(!"Unhandled or unimplemented BlockEntity update request!"); break;
}
Pkt.WriteByte(Action);
@@ -2285,6 +2287,18 @@ void cProtocol172::cPacketizer::WriteBlockEntity(const cBlockEntity & a_BlockEnt
}
break;
}
+ case E_BLOCK_HEAD:
+ {
+ cSkullEntity & SkullEntity = (cSkullEntity &)a_BlockEntity;
+
+ Writer.AddInt("x", SkullEntity.GetPosX());
+ Writer.AddInt("y", SkullEntity.GetPosY());
+ Writer.AddInt("z", SkullEntity.GetPosZ());
+ Writer.AddByte("SkullType", SkullEntity.GetSkullType() & 0xFF);
+ Writer.AddByte("Rot", SkullEntity.GetRotation() & 0xFF);
+ Writer.AddString("ExtraType", SkullEntity.GetOwner().c_str());
+ Writer.AddString("id", "Skull"); // "Tile Entity ID" - MC wiki; vanilla server always seems to send this though
+ }
default: break;
}