diff options
author | Mattes D <github@xoft.cz> | 2014-02-19 22:12:38 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-19 22:12:38 +0100 |
commit | 87db4b6a904f2877919446b8219d659848da89e8 (patch) | |
tree | 617bf18a768a493c2cd428297168f57df0901c26 /src/Protocol/Protocol17x.cpp | |
parent | Merge pull request #694 from mc-server/itemframes (diff) | |
parent | Rename SkullEntity to MobHeadEntity (diff) | |
download | cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar.gz cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar.bz2 cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar.lz cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar.xz cuberite-87db4b6a904f2877919446b8219d659848da89e8.tar.zst cuberite-87db4b6a904f2877919446b8219d659848da89e8.zip |
Diffstat (limited to 'src/Protocol/Protocol17x.cpp')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 0c569c07c..aaf8830cd 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/MobHeadEntity.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 Mobhead entity default: ASSERT(!"Unhandled or unimplemented BlockEntity update request!"); break; } Pkt.WriteByte(Action); @@ -2285,6 +2287,19 @@ void cProtocol172::cPacketizer::WriteBlockEntity(const cBlockEntity & a_BlockEnt } break; } + case E_BLOCK_HEAD: + { + cMobHeadEntity & MobHeadEntity = (cMobHeadEntity &)a_BlockEntity; + + Writer.AddInt("x", MobHeadEntity.GetPosX()); + Writer.AddInt("y", MobHeadEntity.GetPosY()); + Writer.AddInt("z", MobHeadEntity.GetPosZ()); + Writer.AddByte("SkullType", MobHeadEntity.GetType() & 0xFF); + Writer.AddByte("Rot", MobHeadEntity.GetRotation() & 0xFF); + Writer.AddString("ExtraType", MobHeadEntity.GetOwner().c_str()); + Writer.AddString("id", "Skull"); // "Tile Entity ID" - MC wiki; vanilla server always seems to send this though + break; + } default: break; } |