mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
Basiclly Support 0.3.0
This commit is contained in:
parent
e7e7c81e07
commit
20c4f16a52
45 changed files with 245 additions and 127 deletions
|
|
@ -507,11 +507,8 @@ class Player{
|
|||
if(EventHandler::callEvent(new DataPacketSendEvent($this, $packet)) === BaseEvent::DENY) return;
|
||||
if(!$this->convertToLocalEIDPacket($packet)) return false;
|
||||
|
||||
if(PacketPool::isPacketExist($packet->pid(), $this->PROTOCOL) != true){
|
||||
return;
|
||||
}
|
||||
|
||||
$packet->PROTOCOL = $this->PROTOCOL;
|
||||
if(!PacketPool::isPacketExist($packet->pid(), $this->PROTOCOL)) return;
|
||||
$packet->encode();
|
||||
$len = strlen($packet->buffer) + 1;
|
||||
$MTU = $this->MTU - 24;
|
||||
|
|
@ -545,6 +542,7 @@ class Player{
|
|||
$pk->sendtime = microtime(true);
|
||||
|
||||
$packet->PROTOCOL = $this->PROTOCOL;
|
||||
if(!PacketPool::isPacketExist($packet->pid(), $this->PROTOCOL)) return;
|
||||
$packet->encode();
|
||||
$len = strlen($packet->buffer) + 1;
|
||||
$MTU = $this->MTU - 24;
|
||||
|
|
@ -1892,6 +1890,7 @@ class Player{
|
|||
if(!$this->convertToLocalEIDPacket($pk)) return false;
|
||||
|
||||
$pk->PROTOCOL = $this->PROTOCOL;
|
||||
if(!PacketPool::isPacketExist($pk->pid(), $this->PROTOCOL)) return false;
|
||||
$pk->encode();
|
||||
|
||||
$len = 1 + strlen($pk->buffer);
|
||||
|
|
@ -1936,6 +1935,7 @@ class Player{
|
|||
if(EventHandler::callEvent(new DataPacketSendEvent($this, $pk)) === BaseEvent::DENY) return;
|
||||
if(!$this->convertToLocalEIDPacket($pk)) return false;
|
||||
$pk->PROTOCOL = $this->PROTOCOL;
|
||||
if(!PacketPool::isPacketExist($pk->pid(), $this->PROTOCOL)) return false;
|
||||
$pk->encode();
|
||||
$len = 1 + strlen($pk->buffer);
|
||||
$MTU = $this->MTU - 24;
|
||||
|
|
@ -3444,7 +3444,7 @@ class Player{
|
|||
$this->slot = $droppingAbsoluteSlot;
|
||||
} elseif (($this->gamemode & 1) == SURVIVAL) {
|
||||
$count = $this->getItemCount($prevItem->getID(), $prevItem->getMetadata());
|
||||
if ($this->PROTOCOL <= ProtocolInfo6::CURRENT_PROTOCOL_6 && CraftingRecipes::getMCPE032CycleBlockType($this, $prevItem->getID(), $prevItem->getMetadata()) && ($count >= 6 || $prevItem->isPlaceable() || isset($this->isOre[$prevItem->getID()]) === true)) {
|
||||
if ($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6 && CraftingRecipes::getMCPE032CycleBlockType($this, $prevItem->getID(), $prevItem->getMetadata()) && ($count >= 6 || $prevItem->isPlaceable() || isset($this->isOre[$prevItem->getID()]) === true)) {
|
||||
$this->isOre[$prevItem->getID()] = true;
|
||||
}
|
||||
if ($count < $prevItem->count) {
|
||||
|
|
|
|||
|
|
@ -59,17 +59,17 @@ class PacketPool{
|
|||
self::registerPacket(ChunkDataPacket::class);
|
||||
self::registerPacket(ClientConnectPacket::class);
|
||||
self::registerPacket(ClientHandshakePacket::class);
|
||||
self::registerPacket(ContainerClosePacket::class);
|
||||
self::registerPacket(ContainerOpenPacket::class);
|
||||
self::registerPacket(ContainerSetContentPacket::class);
|
||||
self::registerPacket(ContainerSetDataPacket::class);
|
||||
self::registerPacket(ContainerSetSlotPacket::class);
|
||||
self::registerPacket(ContainerAckPacket::class);
|
||||
self::registerPacket(ContainerClosePacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ContainerOpenPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ContainerSetContentPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ContainerSetDataPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ContainerSetSlotPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ContainerAckPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
|
||||
self::registerPacket(DisconnectPacket::class);
|
||||
self::registerPacket(DropItemPacket::class);
|
||||
self::registerPacket(DropItemPacket::class, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
|
||||
self::registerPacket(EntityDataPacket::class, [6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(EntityDataPacket::class, [7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(EntityEventPacket::class);
|
||||
self::registerPacket(ExplodePacket::class);
|
||||
|
||||
|
|
@ -100,20 +100,20 @@ class PacketPool{
|
|||
self::registerPacket(RemovePlayerPacket::class);
|
||||
self::registerPacket(RequestChunkPacket::class);
|
||||
self::registerPacket(RespawnPacket::class);
|
||||
self::registerPacket(RotateHeadPacket::class);
|
||||
self::registerPacket(RotateHeadPacket::class, [12, 13, 14]);
|
||||
|
||||
self::registerPacket(SendInventoryPacket::class);
|
||||
self::registerPacket(SendInventoryPacket::class, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(ServerHandshakePacket::class);
|
||||
self::registerPacket(SetEntityDataPacket::class);
|
||||
self::registerPacket(SetEntityLinkPacket::class, [12, 13, 14]);
|
||||
self::registerPacket(SetEntityMotionPacket::class, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(SetEntityMotionPacket::class, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(SetHealthPacket::class);
|
||||
self::registerPacket(SetSpawnPositionPacket::class, [8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(SetTimePacket::class);
|
||||
self::registerPacket(StartGamePacket::class);
|
||||
|
||||
self::registerPacket(TakeItemEntityPacket::class);
|
||||
self::registerPacket(TileEventPacket::class, [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
self::registerPacket(TileEventPacket::class, [5, 6, 7, 8, 9, 10, 11, 12, 13, 14]);
|
||||
|
||||
self::registerPacket(UpdateBlockPacket::class);
|
||||
self::registerPacket(UseItemPacket::class);
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ abstract class ProtocolInfo8{
|
|||
}
|
||||
abstract class ProtocolInfo6{
|
||||
|
||||
const CURRENT_PROTOCOL_7 = 7;
|
||||
const CURRENT_PROTOCOL_6 = 6;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
|
@ -307,30 +308,27 @@ abstract class ProtocolInfo6{
|
|||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
|
||||
const MOVE_ENTITY_PACKET = 0x90;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POS = 0x91;//unused ?
|
||||
const MOVE_ENTITY_PACKET_ROT = 0x92;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x93;
|
||||
const MOVE_PLAYER_PACKET = 0x94;
|
||||
const PLACE_BLOCK_PACKET = 0x95;
|
||||
const REMOVE_BLOCK_PACKET = 0x96;
|
||||
const UPDATE_BLOCK_PACKET = 0x97;
|
||||
//const ADD_PAINTING_PACKET = 0x98;
|
||||
const EXPLODE_PACKET = 0x98;// Change
|
||||
const EXPLODE_PACKET = 0x98;
|
||||
const LEVEL_EVENT_PACKET = 0x99;
|
||||
const TILE_EVENT_PACKET = 0x9a;
|
||||
const ENTITY_EVENT_PACKET = 0x9b;
|
||||
const REQUEST_CHUNK_PACKET = 0x9c;
|
||||
const CHUNK_DATA_PACKET = 0x9d;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9e;
|
||||
// const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0x9f;
|
||||
const USE_ITEM_PACKET = 0xa0;
|
||||
const PLAYER_ACTION_PACKET = 0xa1;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa2;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa3;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa4;
|
||||
//const SET_SPAWN_POSITION_PACKET = 0xa6;
|
||||
const ANIMATE_PACKET = 0xa5;
|
||||
const RESPAWN_PACKET = 0xa6;
|
||||
const SEND_INVENTORY_PACKET = 0xa7;
|
||||
|
|
@ -345,9 +343,9 @@ abstract class ProtocolInfo6{
|
|||
const ENTITY_DATA_PACKET = 0xb0;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
}
|
||||
abstract class ProtocolInfo4{
|
||||
abstract class ProtocolInfo5{
|
||||
|
||||
const CURRENT_PROTOCOL_4 = 4;
|
||||
const CURRENT_PROTOCOL_5 = 5;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
|
|
@ -374,13 +372,13 @@ abstract class ProtocolInfo4{
|
|||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//unused ?
|
||||
|
||||
const MOVE_ENTITY_PACKET_POS = 0x90;//unused ?
|
||||
const MOVE_ENTITY_PACKET_ROT = 0X91;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x92;
|
||||
const MOVE_PLAYER_PACKET = 0x93;
|
||||
const PLACE_BLOCK_PACKET = 0x94;
|
||||
const REMOVE_BLOCK_PACKET = 0x95;//Maybe exist
|
||||
const UPDATE_BLOCK_PACKET = 0x96;
|
||||
//const ADD_PAINTING_PACKET = 0x98;
|
||||
const EXPLODE_PACKET = 0x97;
|
||||
const LEVEL_EVENT_PACKET = 0x98;
|
||||
const TILE_EVENT_PACKET = 0x99;
|
||||
|
|
@ -388,15 +386,11 @@ abstract class ProtocolInfo4{
|
|||
const REQUEST_CHUNK_PACKET = 0x9b;
|
||||
const CHUNK_DATA_PACKET = 0x9c;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9d;
|
||||
// const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0x9e;
|
||||
const USE_ITEM_PACKET = 0x9f;
|
||||
// const PLAYER_ACTION_PACKET = 0xa1;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa0;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa1;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa2;
|
||||
//const SET_SPAWN_POSITION_PACKET = 0xa6;
|
||||
const ANIMATE_PACKET = 0xa3;
|
||||
const RESPAWN_PACKET = 0xa4;
|
||||
const SEND_INVENTORY_PACKET = 0xa5;
|
||||
|
|
@ -407,12 +401,10 @@ abstract class ProtocolInfo4{
|
|||
const CONTAINER_SET_DATA_PACKET = 0xaa;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xab;
|
||||
const CONTAINER_ACK_PACKET = 0xac;
|
||||
//const CHAT_PACKET = 0xaf;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
}
|
||||
abstract class ProtocolInfo3{
|
||||
abstract class ProtocolInfo4{
|
||||
|
||||
const CURRENT_PROTOCOL_3 = 3;
|
||||
const CURRENT_PROTOCOL_4 = 4;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
|
|
@ -439,42 +431,98 @@ abstract class ProtocolInfo3{
|
|||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//unused ?
|
||||
|
||||
const MOVE_ENTITY_PACKET_POS = 0x90;//unused ?
|
||||
const MOVE_ENTITY_PACKET_ROT = 0x91;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x92;
|
||||
const MOVE_PLAYER_PACKET = 0x93;
|
||||
const PLACE_BLOCK_PACKET = 0x94;
|
||||
const REMOVE_BLOCK_PACKET = 0x95;
|
||||
const UPDATE_BLOCK_PACKET = 0x96;
|
||||
//const ADD_PAINTING_PACKET = 0x98;
|
||||
const EXPLODE_PACKET = 0x97;
|
||||
const LEVEL_EVENT_PACKET = 0x98;
|
||||
//const TILE_EVENT_PACKET = 0x99;
|
||||
const ENTITY_EVENT_PACKET = 0x99;//Change
|
||||
const REQUEST_CHUNK_PACKET = 0x9a;
|
||||
const CHUNK_DATA_PACKET = 0x9b;//Change
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9c;
|
||||
// const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0x9d;
|
||||
const USE_ITEM_PACKET = 0x9e;
|
||||
// const PLAYER_ACTION_PACKET = 0xa1;
|
||||
const SET_ENTITY_DATA_PACKET = 0x9f;
|
||||
// const SET_ENTITY_MOTION_PACKET = 0xa1;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa0;
|
||||
//const SET_SPAWN_POSITION_PACKET = 0xa6;
|
||||
const ANIMATE_PACKET = 0xa1;
|
||||
const RESPAWN_PACKET = 0xa2;
|
||||
const SEND_INVENTORY_PACKET = 0xa3;
|
||||
const DROP_ITEM_PACKET = 0xa4;
|
||||
const CONTAINER_OPEN_PACKET = 0xa7;
|
||||
const CONTAINER_CLOSE_PACKET = 0xa8;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xa9;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xaa;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xab;
|
||||
const CONTAINER_ACK_PACKET = 0xac;
|
||||
//const CHAT_PACKET = 0xaf;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
const CONTAINER_OPEN_PACKET = 0xa5;
|
||||
const CONTAINER_CLOSE_PACKET = 0xa6;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xa7;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xa8;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xa9;
|
||||
const CONTAINER_ACK_PACKET = 0xaa;
|
||||
}
|
||||
abstract class ProtocolInfo3{
|
||||
|
||||
const CURRENT_PROTOCOL_3 = 3;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x86;
|
||||
const LOGIN_STATUS_PACKET = 0x87;
|
||||
const READY_PACKET = 0x88;
|
||||
const MESSAGE_PACKET = 0x89;
|
||||
const SET_TIME_PACKET = 0x8a;
|
||||
const START_GAME_PACKET = 0x8b;
|
||||
const ADD_MOB_PACKET = 0x8c;
|
||||
const ADD_PLAYER_PACKET = 0x8d;
|
||||
const REMOVE_PLAYER_PACKET = 0x8e;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8f; //Maybe exist
|
||||
const REMOVE_ENTITY_PACKET = 0x90;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x91;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x92;
|
||||
const MOVE_ENTITY_PACKET = 0x93;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POS = 0x94;//unused ?
|
||||
const MOVE_ENTITY_PACKET_ROT = 0x95;//unused ?
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x96;
|
||||
const MOVE_PLAYER_PACKET = 0x97;
|
||||
const PLACE_BLOCK_PACKET = 0x98;
|
||||
const REMOVE_BLOCK_PACKET = 0x99;
|
||||
const UPDATE_BLOCK_PACKET = 0x9a;
|
||||
const EXPLODE_PACKET = 0x9b;
|
||||
const LEVEL_EVENT_PACKET = 0x9c;
|
||||
const ENTITY_EVENT_PACKET = 0x9d;
|
||||
const REQUEST_CHUNK_PACKET = 0x9e;
|
||||
const CHUNK_DATA_PACKET = 0x9f;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa1;
|
||||
const USE_ITEM_PACKET = 0xa2;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa3;
|
||||
const SET_HEALTH_PACKET = 0xa4;
|
||||
const ANIMATE_PACKET = 0xa5;
|
||||
const RESPAWN_PACKET = 0xa6;
|
||||
}
|
||||
abstract class ProtocolInfo18{ //evil skidcode company
|
||||
const CURRENT_PROTOCOL_18 = 18;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
const FULL_CHUNK_DATA_PACKET = 0xba;
|
||||
const UNLOAD_CHUNK_PACKET = 0xbb;
|
||||
|
||||
}
|
||||
/*Unused:
|
||||
* 0xb5
|
||||
* 0xb9
|
||||
* 0x96
|
||||
* 0x17
|
||||
* 0x14
|
||||
*/
|
||||
|
||||
/***REM_START***/
|
||||
require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php");
|
||||
/***REM_END***/
|
||||
|
|
|
|||
|
|
@ -12,8 +12,10 @@ class AddEntityPacket extends RakNetDataPacket{
|
|||
public $speedZ;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::ADD_ENTITY_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ADD_ENTITY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::ADD_ENTITY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ADD_ENTITY_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ class AddItemEntityPacket extends RakNetDataPacket{
|
|||
public $speedZ;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::ADD_ITEM_ENTITY_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ADD_ITEM_ENTITY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::ADD_ITEM_ENTITY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ADD_ITEM_ENTITY_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ class AddMobPacket extends RakNetDataPacket{
|
|||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ADD_MOB_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ADD_MOB_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,9 @@ class AddPlayerPacket extends RakNetDataPacket{
|
|||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ADD_PLAYER_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ADD_PLAYER_PACKET;
|
||||
}
|
||||
|
||||
|
|
@ -44,7 +47,9 @@ class AddPlayerPacket extends RakNetDataPacket{
|
|||
$this->putByte($this->pitch);
|
||||
$this->putShort($this->itemID);
|
||||
$this->putShort($this->itemAuxValue); //Example: bow shooting power
|
||||
if($this->PROTOCOL >= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$this->put(Utils::writeMetadata($this->metadata));
|
||||
}
|
||||
}
|
||||
|
||||
public function eidsToLocal(Player $p){
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ class AdventureSettingsPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,10 +8,12 @@ class AnimatePacket extends RakNetDataPacket{
|
|||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
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 < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::ANIMATE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -7,9 +7,11 @@ class ChunkDataPacket extends RakNetDataPacket{
|
|||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::CHUNK_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo3::CHUNK_DATA_PACKET;//Same as 18
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CHUNK_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CHUNK_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CHUNK_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ class ContainerAckPacket extends RakNetDataPacket{
|
|||
public $write0;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_ACK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@ class ContainerClosePacket extends RakNetDataPacket{
|
|||
public $windowid;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_CLOSE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@ class ContainerOpenPacket extends RakNetDataPacket{
|
|||
public $unknownstring;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
return ProtocolInfo8::CONTAINER_OPEN_PACKET;
|
||||
return ProtocolInfo8::CONTAINER_OPN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
return ProtocolInfo9::CONTAINER_OPEN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ class ContainerSetContentPacket extends RakNetDataPacket{
|
|||
public $hotbar = array();
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_SET_CONTENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ 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 < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_SET_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ 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 < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::CONTAINER_SET_SLOT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@ class DropItemPacket extends RakNetDataPacket{
|
|||
public $item;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::DROP_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ class EntityEventPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::ENTITY_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::ENTITY_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::ENTITY_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::ENTITY_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ class ExplodePacket extends RakNetDataPacket{
|
|||
public $records;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::EXPLODE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::EXPLODE_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::EXPLODE_PACKET;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,10 @@ class InteractPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::INTERACT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::INTERACT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::INTERACT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::INTERACT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ class LevelEventPacket extends RakNetDataPacket{
|
|||
public $data;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::LEVEL_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::LEVEL_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::LEVEL_EVENT_PACKET;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ class LoginStatusPacket extends RakNetDataPacket{
|
|||
public $status;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::LOGIN_STATUS_PACKET;
|
||||
}
|
||||
return ProtocolInfo::LOGIN_STATUS_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class MessagePacket extends RakNetDataPacket{
|
|||
public $message;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::MESSAGE_PACKET;
|
||||
}
|
||||
return ProtocolInfo::MESSAGE_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@
|
|||
class MoveEntityPacket extends RakNetDataPacket{
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::MOVE_ENTITY_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::MOVE_ENTITY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::MOVE_ENTITY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::MOVE_ENTITY_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ class MoveEntityPacket_PosRot extends RakNetDataPacket{
|
|||
public $pitch;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::MOVE_ENTITY_PACKET_POSROT;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::MOVE_ENTITY_PACKET_POSROT;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::MOVE_ENTITY_PACKET_POSROT;
|
||||
}
|
||||
return ProtocolInfo::MOVE_ENTITY_PACKET_POSROT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ class MovePlayerPacket extends RakNetDataPacket{
|
|||
public $bodyYaw;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::MOVE_PLAYER_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::MOVE_PLAYER_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::MOVE_PLAYER_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::MOVE_PLAYER_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,10 @@ class PlaceBlockPacket extends RakNetDataPacket{
|
|||
public $face;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::PLACE_BLOCK_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::PLACE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::PLACE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL) {
|
||||
return ProtocolInfo12::PLACE_BLOCK_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::PLAYER_EQUIPMENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::PLAYER_EQUIPMENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::PLAYER_EQUIPMENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::PLAYER_EQUIPMENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ class ReadyPacket extends RakNetDataPacket{
|
|||
public $status;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::READY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::READY_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ class RemoveBlockPacket extends RakNetDataPacket{
|
|||
public $z;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::REMOVE_BLOCK_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::REMOVE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::REMOVE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::REMOVE_BLOCK_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@ class RemoveEntityPacket extends RakNetDataPacket{
|
|||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::REMOVE_ENTITY_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::REMOVE_ENTITY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::REMOVE_ENTITY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::REMOVE_ENTITY_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class RemovePlayerPacket extends RakNetDataPacket{
|
|||
public $clientID;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::REMOVE_PLAYER_PACKET;
|
||||
}
|
||||
return ProtocolInfo::REMOVE_PLAYER_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ class RequestChunkPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::REQUEST_CHUNK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::REQUEST_CHUNK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::REQUEST_CHUNK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::REQUEST_CHUNK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ class RespawnPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::RESPAWN_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ class SendInventoryPacket extends RakNetDataPacket{
|
|||
public $armor = [];
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::SEND_INVENTORY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ class SetEntityDataPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::SET_ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::SET_ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::SET_ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::SET_ENTITY_DATA_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ class SetEntityMotionPacket extends RakNetDataPacket{
|
|||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::SET_ENTITY_MOTION_PACKET;
|
||||
return ProtocolInfo5::SET_ENTITY_MOTION_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::SET_ENTITY_MOTION_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ class SetHealthPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::SET_HEALTH_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class SetTimePacket extends RakNetDataPacket{
|
|||
public $started = true;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::SET_TIME_PACKET;
|
||||
}
|
||||
return ProtocolInfo::SET_TIME_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ class StartGamePacket extends RakNetDataPacket{
|
|||
public $z;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::START_GAME_PACKET;
|
||||
}
|
||||
return ProtocolInfo::START_GAME_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ class TakeItemEntityPacket extends RakNetDataPacket{
|
|||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::TAKE_ITEM_ENTITY_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::TAKE_ITEM_ENTITY_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::TAKE_ITEM_ENTITY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::TAKE_ITEM_ENTITY_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class TileEventPacket extends RakNetDataPacket{
|
|||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::TILE_EVENT_PACKET;
|
||||
return ProtocolInfo5::TILE_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::TILE_EVENT_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ class UpdateBlockPacket extends RakNetDataPacket{
|
|||
public $meta;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo4::UPDATE_BLOCK_PACKET;
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::UPDATE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::UPDATE_BLOCK_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::UPDATE_BLOCK_PACKET;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,10 @@ class UseItemPacket extends RakNetDataPacket{
|
|||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo4::CURRENT_PROTOCOL_4){
|
||||
return ProtocolInfo3::USE_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($this->PROTOCOL < ProtocolInfo5::CURRENT_PROTOCOL_5){
|
||||
return ProtocolInfo4::USE_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
return ProtocolInfo5::USE_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo8::CURRENT_PROTOCOL_8){
|
||||
return ProtocolInfo6::USE_ITEM_PACKET;
|
||||
}elseif($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
|
||||
|
|
|
|||
|
|
@ -495,12 +495,12 @@ class CraftingRecipes{
|
|||
}
|
||||
|
||||
foreach(CraftingRecipes::$legacy_small as $recipe){
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_INVENTORY, ProtocolInfo6::CURRENT_PROTOCOL_6);
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_CRAFTIGTABLE, ProtocolInfo6::CURRENT_PROTOCOL_6);
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_INVENTORY, ProtocolInfo5::CURRENT_PROTOCOL_5);
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_CRAFTIGTABLE, ProtocolInfo5::CURRENT_PROTOCOL_5);
|
||||
}
|
||||
|
||||
foreach(CraftingRecipes::$legacy_big as $recipe){
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_CRAFTIGTABLE, ProtocolInfo6::CURRENT_PROTOCOL_6);
|
||||
CraftingRecipes::addRecipe($recipe, self::TYPE_CRAFTIGTABLE, ProtocolInfo5::CURRENT_PROTOCOL_5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -567,10 +567,10 @@ class CraftingRecipes{
|
|||
}
|
||||
}
|
||||
|
||||
}elseif($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol > ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol >= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if(!isset($arr_old[$result_index])) $arr_old[$result_index] = [];
|
||||
$arr_old[$result_index][] = $ingridients_arr;
|
||||
}elseif($protocol <= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
}elseif($protocol < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if(!isset($arr_legacy[$result_index])) $arr_legacy[$result_index] = [];
|
||||
$arr_legacy[$result_index][] = $ingridients_arr;
|
||||
}
|
||||
|
|
@ -613,19 +613,19 @@ class CraftingRecipes{
|
|||
}
|
||||
|
||||
$protocolId = ProtocolInfo::CURRENT_PROTOCOL;
|
||||
if($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol > ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol >= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo8::CURRENT_PROTOCOL_8;
|
||||
}elseif($protocol <= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo6::CURRENT_PROTOCOL_6;
|
||||
}elseif($protocol < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo5::CURRENT_PROTOCOL_5;
|
||||
}
|
||||
|
||||
if(isset($arr_r[$craftItem->getID()][$craftItem->getMetadata()][$protocolId])){
|
||||
$craftIndex = $arr_r[$craftItem->getID()][$craftItem->getMetadata()][$protocolId];
|
||||
if($protocol >= ProtocolInfo9::CURRENT_PROTOCOL_9 && isset($arr[$craftIndex])) {
|
||||
return $arr[$craftIndex];
|
||||
}elseif($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol > ProtocolInfo6::CURRENT_PROTOCOL_6 && isset($arr_old[$craftIndex])){
|
||||
}elseif($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol >= ProtocolInfo6::CURRENT_PROTOCOL_6 && isset($arr_old[$craftIndex])){
|
||||
return $arr_old[$craftIndex];
|
||||
}elseif($protocol <= ProtocolInfo6::CURRENT_PROTOCOL_6 && isset($arr_legacy[$craftIndex])){
|
||||
}elseif($protocol < ProtocolInfo6::CURRENT_PROTOCOL_6 && isset($arr_legacy[$craftIndex])){
|
||||
return $arr_legacy[$craftIndex];
|
||||
}
|
||||
}
|
||||
|
|
@ -702,10 +702,10 @@ class CraftingRecipes{
|
|||
}
|
||||
|
||||
$protocolId = ProtocolInfo::CURRENT_PROTOCOL;
|
||||
if($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol > ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
if($protocol <= ProtocolInfo8::CURRENT_PROTOCOL_8 && $protocol >= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo8::CURRENT_PROTOCOL_8;
|
||||
}elseif($protocol <= ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo6::CURRENT_PROTOCOL_6;
|
||||
}elseif($protocol < ProtocolInfo6::CURRENT_PROTOCOL_6){
|
||||
$protocolId = ProtocolInfo5::CURRENT_PROTOCOL_5;
|
||||
}
|
||||
|
||||
if($protocol <= ProtocolInfo9::CURRENT_PROTOCOL_9 && $protocol > ProtocolInfo8::CURRENT_PROTOCOL_8 && $craftItem->getID() === SLAB && $craftItem->getMetadata() === 2){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue