summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorbibo38 <bibo38@users.noreply.github.com>2016-10-12 14:38:45 +0200
committerMattes D <github@xoft.cz>2016-10-12 14:38:45 +0200
commitcb640ffea4a51a10db2e379ada8dc0487378ba09 (patch)
tree780ff243f439c9663b2f88e5df2805cc503f4f1d /src/Protocol/Protocol18x.cpp
parentFixed cProjectileEntity double destroy bug (#3397) (diff)
downloadcuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.gz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.bz2
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.lz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.xz
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.zst
cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol18x.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index c1018324f..d75ab3a5c 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -246,6 +246,16 @@ void cProtocol180::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
+void cProtocol180::SendCameraSetTo(const cEntity & a_Entity)
+{
+ cPacketizer Pkt(*this, 0x43); // Camera Packet (Attach the camera of a player at another entity in spectator mode)
+ Pkt.WriteVarInt32(a_Entity.GetUniqueID());
+}
+
+
+
+
+
void cProtocol180::SendChat(const AString & a_Message, eChatType a_Type)
{
ASSERT(m_State == 3); // In game mode?
@@ -2038,6 +2048,7 @@ bool cProtocol180::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType)
case 0x15: HandlePacketClientSettings (a_ByteBuffer); return true;
case 0x16: HandlePacketClientStatus (a_ByteBuffer); return true;
case 0x17: HandlePacketPluginMessage (a_ByteBuffer); return true;
+ case 0x18: HandlePacketSpectate (a_ByteBuffer); return true;
}
break;
}
@@ -2495,6 +2506,21 @@ void cProtocol180::HandlePacketSlotSelect(cByteBuffer & a_ByteBuffer)
+void cProtocol180::HandlePacketSpectate(cByteBuffer &a_ByteBuffer)
+{
+ AString playerUUID;
+ if (!a_ByteBuffer.ReadUUID(playerUUID))
+ {
+ return;
+ }
+
+ m_Client->HandleSpectate(playerUUID);
+}
+
+
+
+
+
void cProtocol180::HandlePacketSteerVehicle(cByteBuffer & a_ByteBuffer)
{
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, Sideways);