This commit is contained in:
Sunch 2025-04-29 19:21:59 +08:00
parent 26cafcab00
commit 1e85a65764
52 changed files with 2400 additions and 2406 deletions

View file

@ -12,9 +12,9 @@ class AddEntityPacket extends RakNetDataPacket{
public $speedZ;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ADD_ENTITY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ADD_ENTITY_PACKET;
}
return ProtocolInfo::ADD_ENTITY_PACKET;
}

View file

@ -11,9 +11,9 @@ class AddItemEntityPacket extends RakNetDataPacket{
public $roll;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ADD_ITEM_ENTITY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ADD_ITEM_ENTITY_PACKET;
}
return ProtocolInfo::ADD_ITEM_ENTITY_PACKET;
}

View file

@ -9,9 +9,9 @@ class AddPaintingPacket extends RakNetDataPacket{
public $title;
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ADD_PAINTING_PACKET;
}
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ADD_PAINTING_PACKET;
}
return ProtocolInfo::ADD_PAINTING_PACKET;
}

View file

@ -4,13 +4,13 @@ class AdventureSettingsPacket extends RakNetDataPacket{
public $flags;
public function pid(){
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ADVENTURE_SETTINGS_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ADVENTURE_SETTINGS_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ADVENTURE_SETTINGS_PACKET;
}
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ADVENTURE_SETTINGS_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ADVENTURE_SETTINGS_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ADVENTURE_SETTINGS_PACKET;
}
return ProtocolInfo::ADVENTURE_SETTINGS_PACKET;
}

View file

@ -8,19 +8,19 @@ class AnimatePacket extends RakNetDataPacket{
public $eid;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ANIMATE_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ANIMATE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ANIMATE_PACKET;
}
return ProtocolInfo::ANIMATE_PACKET;
}

View file

@ -4,15 +4,15 @@ class ChatPacket extends RakNetDataPacket{
public $message;
public function pid(){
if($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CHAT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CHAT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CHAT_PACKET;
}
return ProtocolInfo::CHAT_PACKET;
}

View file

@ -6,15 +6,15 @@ class ChunkDataPacket extends RakNetDataPacket{
public $data;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CHUNK_DATA_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CHUNK_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CHUNK_DATA_PACKET;
}
return ProtocolInfo::CHUNK_DATA_PACKET;
}

View file

@ -1,46 +1,46 @@
<?php
class ContainerAckPacket extends RakNetDataPacket{
public $unknwonubyte1;
public $unknownshort;
public $write1;
public $write0;
public $unknwonubyte1;
public $unknownshort;
public $write1;
public $write0;
public function pid(){
if($this->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 pid(){
if($this->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 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);
}
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);
}
}

View file

@ -4,19 +4,19 @@ class ContainerClosePacket extends RakNetDataPacket{
public $windowid;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_CLOSE_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_CLOSE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_CLOSE_PACKET;
}
return ProtocolInfo::CONTAINER_CLOSE_PACKET;
}

View file

@ -9,19 +9,19 @@ class ContainerOpenPacket extends RakNetDataPacket{
public $z;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_OPEN_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_OPEN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_OPEN_PACKET;
}
return ProtocolInfo::CONTAINER_OPEN_PACKET;
}

View file

@ -6,19 +6,19 @@ class ContainerSetContentPacket extends RakNetDataPacket{
public $hotbar = [];
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_SET_CONTENT_PACKET;
}else if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_CONTENT_PACKET;
}
return ProtocolInfo9::CONTAINER_SET_CONTENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_CONTENT_PACKET;
}
return ProtocolInfo::CONTAINER_SET_CONTENT_PACKET;
}

View file

@ -6,19 +6,19 @@ class ContainerSetDataPacket extends RakNetDataPacket{
public $value;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_SET_DATA_PACKET;
}else if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_DATA_PACKET;
}
return ProtocolInfo9::CONTAINER_SET_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_DATA_PACKET;
}
return ProtocolInfo::CONTAINER_SET_DATA_PACKET;
}

View file

@ -6,19 +6,19 @@ class ContainerSetSlotPacket extends RakNetDataPacket{
public $item;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_SLOT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::CONTAINER_SET_SLOT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::CONTAINER_SET_SLOT_PACKET;
}
return ProtocolInfo::CONTAINER_SET_SLOT_PACKET;
}

View file

@ -6,19 +6,19 @@ class DropItemPacket extends RakNetDataPacket{
public $item;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::DROP_ITEM_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::DROP_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::DROP_ITEM_PACKET;
}
return ProtocolInfo::DROP_ITEM_PACKET;
}

View file

@ -7,13 +7,13 @@ class EntityDataPacket extends RakNetDataPacket{
public $namedtag;
public function pid(){
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ENTITY_DATA_PACKET;
}
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ENTITY_DATA_PACKET;
}
return ProtocolInfo::ENTITY_DATA_PACKET;
}

View file

@ -14,15 +14,15 @@ class EntityEventPacket extends RakNetDataPacket{
}
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ENTITY_EVENT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::ENTITY_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ENTITY_EVENT_PACKET;
}
return ProtocolInfo::ENTITY_EVENT_PACKET;
}

View file

@ -8,13 +8,13 @@ class ExplodePacket extends RakNetDataPacket{
public $records;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::EXPLODE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::EXPLODE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::EXPLODE_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::EXPLODE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::EXPLODE_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::EXPLODE_PACKET;
}
return ProtocolInfo::EXPLODE_PACKET;
}

View file

@ -4,9 +4,9 @@ class HurtArmorPacket extends RakNetDataPacket{
public $health;
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::HURT_ARMOR_PACKET;
}
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::HURT_ARMOR_PACKET;
}
return ProtocolInfo::HURT_ARMOR_PACKET;
}

View file

@ -9,17 +9,17 @@ class InteractPacket extends RakNetDataPacket{
public $target;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::INTERACT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::INTERACT_PACKET;
}
return ProtocolInfo::INTERACT_PACKET;
}

View file

@ -12,13 +12,13 @@ class LevelEventPacket extends RakNetDataPacket{
public $data;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::LEVEL_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::LEVEL_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::LEVEL_EVENT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::LEVEL_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::LEVEL_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::LEVEL_EVENT_PACKET;
}
return ProtocolInfo::LEVEL_EVENT_PACKET;
}

View file

@ -17,8 +17,8 @@ class LoginPacket extends RakNetDataPacket{
$this->protocol2 = $this->getInt();
$this->clientId = $this->getInt();//null
$this->loginData = $this->getString();
$this->PROTOCOL = $this->protocol1;
}
$this->PROTOCOL = $this->protocol1;
}
public function encode(){

View file

@ -9,17 +9,17 @@ class MessagePacket extends RakNetDataPacket{
}
public function decode(){
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
$this->source = $this->getString();
}
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
$this->source = $this->getString();
}
$this->message = $this->getString();
}
public function encode(){
$this->reset();
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
$this->putString($this->source);
}
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
$this->putString($this->source);
}
$this->putString($this->message);
}

View file

@ -3,9 +3,9 @@
class MoveEntityPacket extends RakNetDataPacket{
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_ENTITY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_ENTITY_PACKET;
}
return ProtocolInfo::MOVE_ENTITY_PACKET;
}

View file

@ -9,9 +9,9 @@ class MoveEntityPacket_PosRot extends RakNetDataPacket{
public $pitch;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_ENTITY_PACKET_POSROT;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_ENTITY_PACKET_POSROT;
}
return ProtocolInfo::MOVE_ENTITY_PACKET_POSROT;
}

View file

@ -10,11 +10,11 @@ class MovePlayerPacket extends RakNetDataPacket{
public $bodyYaw;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_PLAYER_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::MOVE_PLAYER_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::MOVE_PLAYER_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::MOVE_PLAYER_PACKET;
}
return ProtocolInfo::MOVE_PLAYER_PACKET;
}
@ -25,9 +25,9 @@ class MovePlayerPacket extends RakNetDataPacket{
$this->z = $this->getFloat();
$this->yaw = $this->getFloat();
$this->pitch = $this->getFloat();
if($this->PROTOCOL > 13){
$this->bodyYaw = $this->getFloat();
}
if($this->PROTOCOL > 13){
$this->bodyYaw = $this->getFloat();
}
}
public function encode(){
@ -38,9 +38,9 @@ class MovePlayerPacket extends RakNetDataPacket{
$this->putFloat($this->z);
$this->putFloat($this->yaw);
$this->putFloat($this->pitch);
if($this->PROTOCOL > 13){
$this->putFloat($this->bodyYaw);
}
if($this->PROTOCOL > 13){
$this->putFloat($this->bodyYaw);
}
}
}

View file

@ -1,42 +1,42 @@
<?php
class PlaceBlockPacket extends RakNetDataPacket{
public $eid;
public $x;
public $z;
public $y;
public $block;
public $meta;
public $face;
public $eid;
public $x;
public $z;
public $y;
public $block;
public $meta;
public $face;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::PLACE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL) {
return ProtocolInfo12::PLACE_BLOCK_PACKET;
}
return ProtocolInfo::PLACE_BLOCK_PACKET;
}
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::PLACE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL) {
return ProtocolInfo12::PLACE_BLOCK_PACKET;
}
return ProtocolInfo::PLACE_BLOCK_PACKET;
}
public function decode(){
$this->eid = $this->getInt();
$this->x = $this->getInt();
$this->z = $this->getInt();
$this->y = $this->getByte();
$this->block = $this->getByte();
$this->meta = $this->getByte();
$this->face = $this->getByte();
}
public function decode(){
$this->eid = $this->getInt();
$this->x = $this->getInt();
$this->z = $this->getInt();
$this->y = $this->getByte();
$this->block = $this->getByte();
$this->meta = $this->getByte();
$this->face = $this->getByte();
}
public function encode(){
$this->reset();
$this->putInt($this->eid);
$this->putInt($this->x);
$this->putInt($this->z);
$this->putByte($this->y);
$this->putByte(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->block));
$this->putByte($this->meta);
$this->putByte($this->face);
}
public function encode(){
$this->reset();
$this->putInt($this->eid);
$this->putInt($this->x);
$this->putInt($this->z);
$this->putByte($this->y);
$this->putByte(BlockAPI::convertHighItemIdsToOldItemIds($this->PROTOCOL, $this->block));
$this->putByte($this->meta);
$this->putByte($this->face);
}
}

View file

@ -9,13 +9,13 @@ class PlayerActionPacket extends RakNetDataPacket{
public $eid;
public function pid(){
if($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::PLAYER_ACTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::PLAYER_ACTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_ACTION_PACKET;
}
if($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::PLAYER_ACTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::PLAYER_ACTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_ACTION_PACKET;
}
return ProtocolInfo::PLAYER_ACTION_PACKET;
}

View file

@ -5,9 +5,9 @@ class PlayerArmorEquipmentPacket extends RakNetDataPacket{
public $slots = [];
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_ARMOR_EQUIPMENT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_ARMOR_EQUIPMENT_PACKET;
}
return ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET;
}

View file

@ -7,15 +7,15 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
public $slot;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_EQUIPMENT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::PLAYER_EQUIPMENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_EQUIPMENT_PACKET;
}
return ProtocolInfo::PLAYER_EQUIPMENT_PACKET;
}

View file

@ -8,11 +8,11 @@ class PlayerInputPacket extends RakNetDataPacket{
}
public function pid(){
if($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::PLAYER_INPUT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_INPUT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::PLAYER_INPUT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_INPUT_PACKET;
}
return ProtocolInfo::PLAYER_INPUT_PACKET;
}

View file

@ -7,11 +7,11 @@ class RemoveBlockPacket extends RakNetDataPacket{
public $z;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REMOVE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::REMOVE_BLOCK_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REMOVE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::REMOVE_BLOCK_PACKET;
}
return ProtocolInfo::REMOVE_BLOCK_PACKET;
}

View file

@ -4,9 +4,9 @@ class RemoveEntityPacket extends RakNetDataPacket{
public $eid;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REMOVE_ENTITY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REMOVE_ENTITY_PACKET;
}
return ProtocolInfo::REMOVE_ENTITY_PACKET;
}

View file

@ -5,15 +5,15 @@ class RequestChunkPacket extends RakNetDataPacket{
public $chunkZ;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::REQUEST_CHUNK_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::REQUEST_CHUNK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::REQUEST_CHUNK_PACKET;
}
return ProtocolInfo::REQUEST_CHUNK_PACKET;
}

View file

@ -7,19 +7,19 @@ class RespawnPacket extends RakNetDataPacket{
public $z;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::RESPAWN_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::RESPAWN_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::RESPAWN_PACKET;
}
return ProtocolInfo::RESPAWN_PACKET;
}

View file

@ -11,9 +11,9 @@ class RotateHeadPacket extends RakNetDataPacket{
*/
public $rawYaw = false;
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ROTATE_HEAD_PACKET;
}
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::ROTATE_HEAD_PACKET;
}
return ProtocolInfo::ROTATE_HEAD_PACKET;
}

View file

@ -7,19 +7,19 @@ class SendInventoryPacket extends RakNetDataPacket{
public $armor = [];
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SEND_INVENTORY_PACKET;
}else if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SEND_INVENTORY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SEND_INVENTORY_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SEND_INVENTORY_PACKET;
}
return ProtocolInfo::SEND_INVENTORY_PACKET;
}

View file

@ -5,17 +5,17 @@ class SetEntityDataPacket extends RakNetDataPacket{
public $metadata;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_DATA_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_ENTITY_DATA_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_DATA_PACKET;
}
return ProtocolInfo::SET_ENTITY_DATA_PACKET;
}
@ -25,7 +25,7 @@ class SetEntityDataPacket extends RakNetDataPacket{
public function encode(){
$this->reset();
if($this->PROTOCOL >= ProtocolInfo7::CURRENT_PROTOCOL_7)
if($this->PROTOCOL >= ProtocolInfo7::CURRENT_PROTOCOL_7)
$this->putInt($this->eid);
$this->put(Utils::writeMetadata($this->metadata));
}

View file

@ -22,9 +22,9 @@ class SetEntityLinkPacket extends RakNetDataPacket{
}
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_LINK_PACKET;
}
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_LINK_PACKET;
}
return ProtocolInfo::SET_ENTITY_LINK_PACKET;
}

View file

@ -7,15 +7,15 @@ class SetEntityMotionPacket extends RakNetDataPacket{
public $speedZ;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_MOTION_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_ENTITY_MOTION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_ENTITY_MOTION_PACKET;
}
return ProtocolInfo::SET_ENTITY_MOTION_PACKET;
}

View file

@ -4,19 +4,19 @@ class SetHealthPacket extends RakNetDataPacket{
public $health;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_HEALTH_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SET_HEALTH_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_HEALTH_PACKET;
}
return ProtocolInfo::SET_HEALTH_PACKET;
}

View file

@ -6,13 +6,13 @@ class SetSpawnPositionPacket extends RakNetDataPacket{
public $y;
public function pid(){
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_SPAWN_POSITION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SET_SPAWN_POSITION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_SPAWN_POSITION_PACKET;
}
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::SET_SPAWN_POSITION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
return ProtocolInfo9::SET_SPAWN_POSITION_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::SET_SPAWN_POSITION_PACKET;
}
return ProtocolInfo::SET_SPAWN_POSITION_PACKET;
}

View file

@ -5,9 +5,9 @@ class TakeItemEntityPacket extends RakNetDataPacket{
public $eid;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::TAKE_ITEM_ENTITY_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::TAKE_ITEM_ENTITY_PACKET;
}
return ProtocolInfo::TAKE_ITEM_ENTITY_PACKET;
}

View file

@ -8,13 +8,13 @@ class TileEventPacket extends RakNetDataPacket{
public $case2;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::TILE_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::TILE_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::TILE_EVENT_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::TILE_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::TILE_EVENT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::TILE_EVENT_PACKET;
}
return ProtocolInfo::TILE_EVENT_PACKET;
}

View file

@ -8,11 +8,11 @@ class UpdateBlockPacket extends RakNetDataPacket{
public $meta;
public function pid(){
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::UPDATE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::UPDATE_BLOCK_PACKET;
}
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::UPDATE_BLOCK_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::UPDATE_BLOCK_PACKET;
}
return ProtocolInfo::UPDATE_BLOCK_PACKET;
}

View file

@ -16,17 +16,17 @@ class UseItemPacket extends RakNetDataPacket{
public $posZ;
public function pid(){
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::USE_ITEM_PACKET;
}
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
return ProtocolInfo3::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
return ProtocolInfo4::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo7::CURRENT_PROTOCOL_7){
return ProtocolInfo5::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::USE_ITEM_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::USE_ITEM_PACKET;
}
return ProtocolInfo::USE_ITEM_PACKET;
}
@ -41,11 +41,11 @@ class UseItemPacket extends RakNetDataPacket{
$this->fx = $this->getFloat();
$this->fy = $this->getFloat();
$this->fz = $this->getFloat();
if ($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9) {
$this->posX = $this->getFloat();
$this->posY = $this->getFloat();
$this->posZ = $this->getFloat();
}
if ($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9) {
$this->posX = $this->getFloat();
$this->posY = $this->getFloat();
$this->posZ = $this->getFloat();
}
}
public function encode(){