diff --git a/src/network/PacketPool.php b/src/network/PacketPool.php index eb9753db..fa7ed5be 100644 --- a/src/network/PacketPool.php +++ b/src/network/PacketPool.php @@ -57,6 +57,7 @@ class PacketPool{ self::registerPacket(ContainerSetContentPacket::class); self::registerPacket(ContainerSetDataPacket::class); self::registerPacket(ContainerSetSlotPacket::class); + self::registerPacket(ContainerAckPacket::class); self::registerPacket(DisconnectPacket::class); self::registerPacket(DropItemPacket::class); diff --git a/src/network/protocol/ProtocolInfo.php b/src/network/protocol/ProtocolInfo.php index f45534c3..fd30aec1 100644 --- a/src/network/protocol/ProtocolInfo.php +++ b/src/network/protocol/ProtocolInfo.php @@ -73,7 +73,6 @@ abstract class ProtocolInfo{ } /*Unused: - * 0xb5 * 0x96 * 0x17 * 0x14 @@ -142,7 +141,7 @@ abstract class ProtocolInfo12{ const CONTAINER_SET_SLOT_PACKET = 0xb1; const CONTAINER_SET_DATA_PACKET = 0xb2; const CONTAINER_SET_CONTENT_PACKET = 0xb3; - const CONTAINER_ACK_PACKET = 0xb5; //Bruh + const CONTAINER_ACK_PACKET = 0xb4; const CHAT_PACKET = 0xb5; const ADVENTURE_SETTINGS_PACKET = 0xb6; const ENTITY_DATA_PACKET = 0xb7; diff --git a/src/network/protocol/packet/ContainerAckPacket.php b/src/network/protocol/packet/ContainerAckPacket.php new file mode 100644 index 00000000..71db5313 --- /dev/null +++ b/src/network/protocol/packet/ContainerAckPacket.php @@ -0,0 +1,46 @@ +PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){ + return ProtocolInfo4::CONTAINER_ACK_PACKET; + }elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){ + return ProtocolInfo5::CONTAINER_ACK_PACKET; + }elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){ + return ProtocolInfo7::CONTAINER_ACK_PACKET; + }elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){ + return ProtocolInfo9::CONTAINER_ACK_PACKET; + }elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){ + return ProtocolInfo12::CONTAINER_ACK_PACKET; + } + return ProtocolInfo::CONTAINER_ACK_PACKET; + } + + public function decode(){ + $this->unknwonubyte1 = $this->getByte(); + $this->unknownshort = $this->getShort(); + $this->write1 = $this->get(); + $this->write0 = $this->get(); + ConsoleAPI::debug($this->unknwonubyte1); + ConsoleAPI::debug($this->unknownshort); + ConsoleAPI::debug($this->write1); + ConsoleAPI::debug($this->write0); + } + + public function encode(){ + $this->putByte($this->unknwonubyte1); + $this->putShort($this->unknownshort); + $this->put($this->write1); + $this->put($this->write0); + ConsoleAPI::debug($this->unknwonubyte1); + ConsoleAPI::debug($this->unknownshort); + ConsoleAPI::debug($this->write1); + ConsoleAPI::debug($this->write0); + } + +} \ No newline at end of file