From 3c348f2e229786cf5513aba161ea999443844974 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 26 Aug 2013 23:29:32 +0200 Subject: [PATCH] Added new EntityData Packet --- src/network/CustomPacketHandler.php | 13 +++++++++++++ src/network/ProtocolInfo.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/network/CustomPacketHandler.php b/src/network/CustomPacketHandler.php index 359485cb8..d06232e59 100644 --- a/src/network/CustomPacketHandler.php +++ b/src/network/CustomPacketHandler.php @@ -834,6 +834,19 @@ class CustomPacketHandler{ $this->raw .= Utils::writeInt($this->data["flags"]); } break; + case MC_ENTITY_DATA: + if($this->c === false){ + $this->data["x"] = Utils::readShort($this->get(2)); + $this->data["y"] = ord($this->get(1)); + $this->data["z"] = Utils::readShort($this->get(2)); + $this->data["namedtag"] = $this->get(true); + }else{ + $this->raw .= Utils::writeShort($this->data["x"]); + $this->raw .= chr($this->data["y"]); + $this->raw .= Utils::writeShort($this->data["z"]); + $this->raw .= Utils::writeShort($this->data["namedtag"]); + } + break; default: if($this->c === false){ console("[DEBUG] Received unknown Data Packet ID 0x".dechex($pid), true, true, 2); diff --git a/src/network/ProtocolInfo.php b/src/network/ProtocolInfo.php index a08afdd94..d95c3e01b 100644 --- a/src/network/ProtocolInfo.php +++ b/src/network/ProtocolInfo.php @@ -166,8 +166,8 @@ class Protocol{ MC_CONTAINER_SET_SLOT => "Set Container Slot", MC_CLIENT_MESSAGE => "Client Message", - //MC_SIGN_UPDATE => "Sign Update", MC_ADVENTURE_SETTINGS => "Adventure Settings", + MC_ENTITY_DATA => "Entity Data", ); public static $packetName = array(