mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
cs fix
This commit is contained in:
parent
26cafcab00
commit
1e85a65764
52 changed files with 2400 additions and 2406 deletions
|
|
@ -645,12 +645,12 @@ class BlockAPI{
|
|||
/**
|
||||
* 方块/物品id转换,防止新版本影响旧版本视觉效果
|
||||
*/
|
||||
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId) : int{
|
||||
if ($protocolId >= ProtocolInfo12::CURRENT_PROTOCOL_12) {
|
||||
return $itemId;
|
||||
}
|
||||
public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId) : int{
|
||||
if ($protocolId >= ProtocolInfo12::CURRENT_PROTOCOL_12) {
|
||||
return $itemId;
|
||||
}
|
||||
|
||||
$idMap = [ //default for protocol < 12
|
||||
$idMap = [ //default for protocol < 12
|
||||
LIT_PUMPKIN => MELON_BLOCK, //block
|
||||
PUMPKIN_SEEDS => MELON_SEEDS, //item
|
||||
PUMPKIN_PIE => BREAD, //item
|
||||
|
|
@ -658,14 +658,14 @@ class BlockAPI{
|
|||
BEETROOT_SEEDS => SEEDS, //item
|
||||
];
|
||||
|
||||
if ($protocolId < ProtocolInfo9::CURRENT_PROTOCOL_9) {
|
||||
$idMap += [
|
||||
NETHERRACK => OBSIDIAN, //block
|
||||
NETHER_BRICK => BRICK, //item
|
||||
NETHER_QUARTZ => BRICK, //item
|
||||
];
|
||||
}
|
||||
if ($protocolId < ProtocolInfo9::CURRENT_PROTOCOL_9) {
|
||||
$idMap += [
|
||||
NETHERRACK => OBSIDIAN, //block
|
||||
NETHER_BRICK => BRICK, //item
|
||||
NETHER_QUARTZ => BRICK, //item
|
||||
];
|
||||
}
|
||||
|
||||
return $idMap[$itemId] ?? $itemId;
|
||||
}
|
||||
return $idMap[$itemId] ?? $itemId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,16 +327,16 @@ class PlayerAPI{
|
|||
return $o;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public static function decodeProtocol($ip){
|
||||
foreach(ServerAPI::request()->clients as $p) {
|
||||
if($p->ip == $ip){
|
||||
return $p->PROTOCOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public static function decodeProtocol($ip){
|
||||
foreach(ServerAPI::request()->clients as $p) {
|
||||
if($p->ip == $ip){
|
||||
return $p->PROTOCOL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function add($CID){
|
||||
if(isset($this->server->clients[$CID])){
|
||||
|
|
|
|||
2754
src/Player.php
2754
src/Player.php
File diff suppressed because it is too large
Load diff
|
|
@ -57,7 +57,7 @@ class PacketPool{
|
|||
self::registerPacket(ContainerSetContentPacket::class);
|
||||
self::registerPacket(ContainerSetDataPacket::class);
|
||||
self::registerPacket(ContainerSetSlotPacket::class);
|
||||
self::registerPacket(ContainerAckPacket::class);
|
||||
self::registerPacket(ContainerAckPacket::class);
|
||||
|
||||
self::registerPacket(DisconnectPacket::class);
|
||||
self::registerPacket(DropItemPacket::class);
|
||||
|
|
|
|||
|
|
@ -78,411 +78,411 @@ abstract class ProtocolInfo{
|
|||
*/
|
||||
abstract class ProtocolInfo12{
|
||||
|
||||
const CURRENT_PROTOCOL_12 = 12;
|
||||
const CURRENT_PROTOCOL_12 = 12;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
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_POSROT = 0x93;
|
||||
const ROTATE_HEAD_PACKET = 0xff;
|
||||
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 = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa1;
|
||||
const USE_ITEM_PACKET = 0xa2;
|
||||
const PLAYER_ACTION_PACKET = 0xa3;
|
||||
const MOVE_ENTITY_PACKET_POSROT = 0x93;
|
||||
const ROTATE_HEAD_PACKET = 0xff;
|
||||
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 = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa1;
|
||||
const USE_ITEM_PACKET = 0xa2;
|
||||
const PLAYER_ACTION_PACKET = 0xa3;
|
||||
|
||||
const HURT_ARMOR_PACKET = 0xa5;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa6;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa7;
|
||||
const SET_ENTITY_LINK_PACKET = 0xa8;
|
||||
const SET_HEALTH_PACKET = 0xa9;
|
||||
const SET_SPAWN_POSITION_PACKET = 0xaa;
|
||||
const ANIMATE_PACKET = 0xab;
|
||||
const RESPAWN_PACKET = 0xac;
|
||||
const SEND_INVENTORY_PACKET = 0xad;
|
||||
const DROP_ITEM_PACKET = 0xae;
|
||||
const CONTAINER_OPEN_PACKET = 0xaf;
|
||||
const CONTAINER_CLOSE_PACKET = 0xb0;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xb1;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xb2;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb3;
|
||||
const CONTAINER_ACK_PACKET = 0xb4;
|
||||
const CHAT_PACKET = 0xb5;
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||
const ENTITY_DATA_PACKET = 0xb7;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
const HURT_ARMOR_PACKET = 0xa5;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa6;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa7;
|
||||
const SET_ENTITY_LINK_PACKET = 0xa8;
|
||||
const SET_HEALTH_PACKET = 0xa9;
|
||||
const SET_SPAWN_POSITION_PACKET = 0xaa;
|
||||
const ANIMATE_PACKET = 0xab;
|
||||
const RESPAWN_PACKET = 0xac;
|
||||
const SEND_INVENTORY_PACKET = 0xad;
|
||||
const DROP_ITEM_PACKET = 0xae;
|
||||
const CONTAINER_OPEN_PACKET = 0xaf;
|
||||
const CONTAINER_CLOSE_PACKET = 0xb0;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xb1;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xb2;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb3;
|
||||
const CONTAINER_ACK_PACKET = 0xb4;
|
||||
const CHAT_PACKET = 0xb5;
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||
const ENTITY_DATA_PACKET = 0xb7;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
}
|
||||
abstract class ProtocolInfo9{
|
||||
|
||||
const CURRENT_PROTOCOL_9 = 9;
|
||||
const CURRENT_PROTOCOL_9 = 9;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
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_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 = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa1;
|
||||
const USE_ITEM_PACKET = 0xa2;
|
||||
const PLAYER_ACTION_PACKET = 0xa3;
|
||||
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 = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa1;
|
||||
const USE_ITEM_PACKET = 0xa2;
|
||||
const PLAYER_ACTION_PACKET = 0xa3;
|
||||
|
||||
const HURT_ARMOR_PACKET = 0xa5;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa6;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa7;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;// Change
|
||||
const SET_HEALTH_PACKET = 0xa8;// Change
|
||||
const SET_SPAWN_POSITION_PACKET = 0xa9;
|
||||
const ANIMATE_PACKET = 0xaa;
|
||||
const RESPAWN_PACKET = 0xab;
|
||||
const SEND_INVENTORY_PACKET = 0xac;
|
||||
const DROP_ITEM_PACKET = 0xad;
|
||||
const CONTAINER_OPEN_PACKET = 0xae;
|
||||
const CONTAINER_CLOSE_PACKET = 0xaf;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xb0;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xb1;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb2;
|
||||
const CONTAINER_ACK_PACKET = 0xb3;
|
||||
const CHAT_PACKET = 0xb4;//12 change
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||
const ENTITY_DATA_PACKET = 0xb7;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
const HURT_ARMOR_PACKET = 0xa5;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa6;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa7;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;// Change
|
||||
const SET_HEALTH_PACKET = 0xa8;// Change
|
||||
const SET_SPAWN_POSITION_PACKET = 0xa9;
|
||||
const ANIMATE_PACKET = 0xaa;
|
||||
const RESPAWN_PACKET = 0xab;
|
||||
const SEND_INVENTORY_PACKET = 0xac;
|
||||
const DROP_ITEM_PACKET = 0xad;
|
||||
const CONTAINER_OPEN_PACKET = 0xae;
|
||||
const CONTAINER_CLOSE_PACKET = 0xaf;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xb0;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xb1;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xb2;
|
||||
const CONTAINER_ACK_PACKET = 0xb3;
|
||||
const CHAT_PACKET = 0xb4;//12 change
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb6;
|
||||
const ENTITY_DATA_PACKET = 0xb7;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
|
||||
}
|
||||
abstract class ProtocolInfo7{
|
||||
|
||||
const CURRENT_PROTOCOL_7 = 7;
|
||||
const CURRENT_PROTOCOL_7 = 7;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;//Maybe Exist
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;//Maybe Exist
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
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_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;// Maybe exist
|
||||
const EXPLODE_PACKET = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;//Maybe exist
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
// const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa0;//Change
|
||||
const USE_ITEM_PACKET = 0xa1;
|
||||
const PLAYER_ACTION_PACKET = 0xa2;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa3;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa4;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa5;
|
||||
const SET_SPAWN_POSITION_PACKET = 0xa6;
|
||||
const ANIMATE_PACKET = 0xa7;
|
||||
const RESPAWN_PACKET = 0xa8;
|
||||
const SEND_INVENTORY_PACKET = 0xa9;//Maybe exist
|
||||
const DROP_ITEM_PACKET = 0xaa;
|
||||
const CONTAINER_OPEN_PACKET = 0xab;
|
||||
const CONTAINER_CLOSE_PACKET = 0xac;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xad;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xae;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xaf;
|
||||
const CONTAINER_ACK_PACKET = 0xb;
|
||||
const CHAT_PACKET = 0xb1;//12 change
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
const ENTITY_DATA_PACKET = 0xb2;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
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;// Maybe exist
|
||||
const EXPLODE_PACKET = 0x99;
|
||||
const LEVEL_EVENT_PACKET = 0x9a;
|
||||
const TILE_EVENT_PACKET = 0x9b;//Maybe exist
|
||||
const ENTITY_EVENT_PACKET = 0x9c;
|
||||
const REQUEST_CHUNK_PACKET = 0x9d;
|
||||
const CHUNK_DATA_PACKET = 0x9e;
|
||||
const PLAYER_EQUIPMENT_PACKET = 0x9f;
|
||||
// const PLAYER_ARMOR_EQUIPMENT_PACKET = 0xa0;
|
||||
const INTERACT_PACKET = 0xa0;//Change
|
||||
const USE_ITEM_PACKET = 0xa1;
|
||||
const PLAYER_ACTION_PACKET = 0xa2;
|
||||
const SET_ENTITY_DATA_PACKET = 0xa3;
|
||||
const SET_ENTITY_MOTION_PACKET = 0xa4;
|
||||
//const SET_ENTITY_LINK_PACKET = 0xa?;
|
||||
const SET_HEALTH_PACKET = 0xa5;
|
||||
const SET_SPAWN_POSITION_PACKET = 0xa6;
|
||||
const ANIMATE_PACKET = 0xa7;
|
||||
const RESPAWN_PACKET = 0xa8;
|
||||
const SEND_INVENTORY_PACKET = 0xa9;//Maybe exist
|
||||
const DROP_ITEM_PACKET = 0xaa;
|
||||
const CONTAINER_OPEN_PACKET = 0xab;
|
||||
const CONTAINER_CLOSE_PACKET = 0xac;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xad;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xae;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xaf;
|
||||
const CONTAINER_ACK_PACKET = 0xb;
|
||||
const CHAT_PACKET = 0xb1;//12 change
|
||||
const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
const ENTITY_DATA_PACKET = 0xb2;
|
||||
const PLAYER_INPUT_PACKET = 0xb9;
|
||||
}
|
||||
abstract class ProtocolInfo5{
|
||||
|
||||
const CURRENT_PROTOCOL_5 = 5;
|
||||
const CURRENT_PROTOCOL_5 = 5;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;//Maybe Exist
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;//Maybe Exist
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
const REMOVE_ENTITY_PACKET = 0x8d;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8f;
|
||||
const MOVE_ENTITY_PACKET = 0x90;
|
||||
const ADD_ENTITY_PACKET = 0x8c;
|
||||
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_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 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;
|
||||
const DROP_ITEM_PACKET = 0xa8;
|
||||
const CONTAINER_OPEN_PACKET = 0xa9;
|
||||
const CONTAINER_CLOSE_PACKET = 0xaa;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xab;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xac;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xad;
|
||||
const CONTAINER_ACK_PACKET = 0xae;
|
||||
const CHAT_PACKET = 0xaf;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
//const ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
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 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;
|
||||
const DROP_ITEM_PACKET = 0xa8;
|
||||
const CONTAINER_OPEN_PACKET = 0xa9;
|
||||
const CONTAINER_CLOSE_PACKET = 0xaa;
|
||||
const CONTAINER_SET_SLOT_PACKET = 0xab;
|
||||
const CONTAINER_SET_DATA_PACKET = 0xac;
|
||||
const CONTAINER_SET_CONTENT_PACKET = 0xad;
|
||||
const CONTAINER_ACK_PACKET = 0xae;
|
||||
const CHAT_PACKET = 0xaf;
|
||||
//const ADVENTURE_SETTINGS_PACKET = 0xb3;
|
||||
//const ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
}
|
||||
abstract class ProtocolInfo4{
|
||||
|
||||
const CURRENT_PROTOCOL_4 = 4;
|
||||
const CURRENT_PROTOCOL_4 = 4;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8b; //Maybe exist // Change
|
||||
const REMOVE_ENTITY_PACKET = 0x8c;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//unused ?
|
||||
const ADD_ENTITY_PACKET = 0x8b; //Maybe exist // Change
|
||||
const REMOVE_ENTITY_PACKET = 0x8c;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//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;
|
||||
const ENTITY_EVENT_PACKET = 0x9a;
|
||||
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;
|
||||
const DROP_ITEM_PACKET = 0xa6;
|
||||
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 ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
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;
|
||||
const ENTITY_EVENT_PACKET = 0x9a;
|
||||
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;
|
||||
const DROP_ITEM_PACKET = 0xa6;
|
||||
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 ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
}
|
||||
abstract class ProtocolInfo3{
|
||||
|
||||
const CURRENT_PROTOCOL_3 = 3;
|
||||
const CURRENT_PROTOCOL_3 = 3;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
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 = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 0x82;
|
||||
const LOGIN_STATUS_PACKET = 0x83;
|
||||
const READY_PACKET = 0x84;
|
||||
const MESSAGE_PACKET = 0x85;
|
||||
const SET_TIME_PACKET = 0x86;
|
||||
const START_GAME_PACKET = 0x87;
|
||||
const ADD_MOB_PACKET = 0x88;
|
||||
const ADD_PLAYER_PACKET = 0x89;
|
||||
const REMOVE_PLAYER_PACKET = 0x8a;
|
||||
|
||||
const ADD_ENTITY_PACKET = 0x8b; //Maybe exist
|
||||
const REMOVE_ENTITY_PACKET = 0x8c;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//unused ?
|
||||
const ADD_ENTITY_PACKET = 0x8b; //Maybe exist
|
||||
const REMOVE_ENTITY_PACKET = 0x8c;
|
||||
const ADD_ITEM_ENTITY_PACKET = 0x8d;
|
||||
const TAKE_ITEM_ENTITY_PACKET = 0x8e;
|
||||
const MOVE_ENTITY_PACKET = 0x8f;//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 ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
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 ENTITY_DATA_PACKET = 0xb2;
|
||||
//const PLAYER_INPUT_PACKET = 0xb9;
|
||||
}
|
||||
/***REM_START***/
|
||||
require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php");
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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(){
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
private $offset = 0;
|
||||
|
||||
public $PROTOCOL = ProtocolInfo::CURRENT_PROTOCOL;
|
||||
|
||||
|
||||
abstract public function encode();
|
||||
|
||||
abstract public function decode();
|
||||
|
|
@ -37,21 +37,21 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
$this->setBuffer(chr($this->pid()));
|
||||
}
|
||||
|
||||
public function isPacketExist(int $protocol) : int{
|
||||
public function isPacketExist(int $protocol) : int{
|
||||
|
||||
$exist = true;
|
||||
return $exist;
|
||||
}
|
||||
$exist = true;
|
||||
return $exist;
|
||||
}
|
||||
|
||||
abstract public function pid();
|
||||
|
||||
public function getInternalPid() : int{
|
||||
$rawProtocol = $this->PROTOCOL;
|
||||
$this->PROTOCOL = ProtocolInfo::CURRENT_PROTOCOL;
|
||||
$pid = (int) $this->pid();
|
||||
$this->PROTOCOL = $rawProtocol;
|
||||
return $pid;
|
||||
}
|
||||
public function getInternalPid() : int{
|
||||
$rawProtocol = $this->PROTOCOL;
|
||||
$this->PROTOCOL = ProtocolInfo::CURRENT_PROTOCOL;
|
||||
$pid = (int) $this->pid();
|
||||
$this->PROTOCOL = $rawProtocol;
|
||||
return $pid;
|
||||
}
|
||||
|
||||
protected function getLong($unsigned = false){
|
||||
return Utils::readLong($this->get(8), $unsigned);
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ class RakNetParser{
|
|||
|
||||
public $packet;
|
||||
private $buffer;
|
||||
private $source;
|
||||
private $source;
|
||||
private $offset;
|
||||
private $isparse = false;
|
||||
private $isparse = false;
|
||||
|
||||
public function __construct(&$buffer, $source){
|
||||
$this->source =& $source;
|
||||
$this->buffer =& $buffer;
|
||||
$this->source = &$source;
|
||||
$this->buffer = &$buffer;
|
||||
$this->offset = 0;
|
||||
if(strlen($this->buffer) > 0){
|
||||
$this->parse();
|
||||
|
|
@ -59,8 +59,8 @@ class RakNetParser{
|
|||
case RakNetInfo::DATA_PACKET_F:
|
||||
$this->packet->seqNumber = $this->getLTriad();
|
||||
$this->packet->data = [];
|
||||
$this->packet->ip = $this->source;
|
||||
$PROTOCOL = PlayerAPI::decodeProtocol($this->packet->ip);
|
||||
$this->packet->ip = $this->source;
|
||||
$PROTOCOL = PlayerAPI::decodeProtocol($this->packet->ip);
|
||||
|
||||
while(!$this->feof() and ($pk = $this->parseDataPacket($PROTOCOL)) instanceof RakNetDataPacket){
|
||||
$this->packet->data[] = $pk;
|
||||
|
|
@ -184,234 +184,234 @@ class RakNetParser{
|
|||
return $data;
|
||||
}
|
||||
|
||||
private function parseDataPacket12(){
|
||||
$packetFlags = $this->getByte();
|
||||
$reliability = ($packetFlags & 0b11100000) >> 5;
|
||||
$hasSplit = ($packetFlags & 0b00010000) > 0;
|
||||
$length = (int) ceil($this->getShort() / 8);
|
||||
if($reliability === 2
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 6
|
||||
or $reliability === 7){
|
||||
$messageIndex = $this->getLTriad();
|
||||
}else{
|
||||
$messageIndex = false;
|
||||
}
|
||||
private function parseDataPacket12(){
|
||||
$packetFlags = $this->getByte();
|
||||
$reliability = ($packetFlags & 0b11100000) >> 5;
|
||||
$hasSplit = ($packetFlags & 0b00010000) > 0;
|
||||
$length = (int) ceil($this->getShort() / 8);
|
||||
if($reliability === 2
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 6
|
||||
or $reliability === 7){
|
||||
$messageIndex = $this->getLTriad();
|
||||
}else{
|
||||
$messageIndex = false;
|
||||
}
|
||||
|
||||
if($reliability === 1
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 7){
|
||||
$orderIndex = $this->getLTriad();
|
||||
$orderChannel = $this->getByte();
|
||||
}else{
|
||||
$orderIndex = false;
|
||||
$orderChannel = false;
|
||||
}
|
||||
if($reliability === 1
|
||||
or $reliability === 3
|
||||
or $reliability === 4
|
||||
or $reliability === 7){
|
||||
$orderIndex = $this->getLTriad();
|
||||
$orderChannel = $this->getByte();
|
||||
}else{
|
||||
$orderIndex = false;
|
||||
$orderChannel = false;
|
||||
}
|
||||
|
||||
if($hasSplit){
|
||||
$splitCount = $this->getInt();
|
||||
$splitID = $this->getShort();
|
||||
$splitIndex = $this->getInt();
|
||||
}else{
|
||||
$splitCount = false;
|
||||
$splitID = false;
|
||||
$splitIndex = false;
|
||||
}
|
||||
if($hasSplit){
|
||||
$splitCount = $this->getInt();
|
||||
$splitID = $this->getShort();
|
||||
$splitIndex = $this->getInt();
|
||||
}else{
|
||||
$splitCount = false;
|
||||
$splitID = false;
|
||||
$splitIndex = false;
|
||||
}
|
||||
|
||||
if($length <= 0
|
||||
or $orderChannel >= 32
|
||||
or ($hasSplit === true and $splitIndex >= $splitCount)){
|
||||
return false;
|
||||
}else{
|
||||
$pid = $this->getByte();
|
||||
$buffer = $this->get($length - 1);
|
||||
if(strlen($buffer) < ($length - 1)){
|
||||
return false;
|
||||
}
|
||||
switch($pid){
|
||||
case ProtocolInfo12::PING_PACKET:
|
||||
$data = new PingPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PONG_PACKET:
|
||||
$data = new PongPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CLIENT_CONNECT_PACKET:
|
||||
$data = new ClientConnectPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SERVER_HANDSHAKE_PACKET:
|
||||
$data = new ServerHandshakePacket;
|
||||
break;
|
||||
case ProtocolInfo12::DISCONNECT_PACKET:
|
||||
$data = new DisconnectPacket;
|
||||
break;
|
||||
case ProtocolInfo12::LOGIN_PACKET:
|
||||
$data = new LoginPacket;
|
||||
break;
|
||||
case ProtocolInfo12::LOGIN_STATUS_PACKET:
|
||||
$data = new LoginStatusPacket;
|
||||
break;
|
||||
case ProtocolInfo12::READY_PACKET:
|
||||
$data = new ReadyPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MESSAGE_PACKET:
|
||||
$data = new MessagePacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_TIME_PACKET:
|
||||
$data = new SetTimePacket;
|
||||
break;
|
||||
case ProtocolInfo12::START_GAME_PACKET:
|
||||
$data = new StartGamePacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_MOB_PACKET:
|
||||
$data = new AddMobPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_PLAYER_PACKET:
|
||||
$data = new AddPlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_PLAYER_PACKET:
|
||||
$data = new RemovePlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_ENTITY_PACKET:
|
||||
$data = new AddEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_ENTITY_PACKET:
|
||||
$data = new RemoveEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_ITEM_ENTITY_PACKET:
|
||||
$data = new AddItemEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::TAKE_ITEM_ENTITY_PACKET:
|
||||
$data = new TakeItemEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_ENTITY_PACKET:
|
||||
$data = new MoveEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_ENTITY_PACKET_POSROT:
|
||||
$data = new MoveEntityPacket_PosRot;
|
||||
break;
|
||||
case ProtocolInfo12::ROTATE_HEAD_PACKET:
|
||||
$data = new RotateHeadPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_PLAYER_PACKET:
|
||||
$data = new MovePlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_BLOCK_PACKET:
|
||||
$data = new RemoveBlockPacket;
|
||||
break;
|
||||
case ProtocolInfo12::UPDATE_BLOCK_PACKET:
|
||||
$data = new UpdateBlockPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_PAINTING_PACKET:
|
||||
$data = new AddPaintingPacket;
|
||||
break;
|
||||
case ProtocolInfo12::EXPLODE_PACKET:
|
||||
$data = new ExplodePacket;
|
||||
break;
|
||||
case ProtocolInfo12::LEVEL_EVENT_PACKET:
|
||||
$data = new LevelEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::TILE_EVENT_PACKET:
|
||||
$data = new TileEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ENTITY_EVENT_PACKET:
|
||||
$data = new EntityEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REQUEST_CHUNK_PACKET:
|
||||
$data = new RequestChunkPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CHUNK_DATA_PACKET:
|
||||
$data = new ChunkDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_EQUIPMENT_PACKET:
|
||||
$data = new PlayerEquipmentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
||||
$data = new PlayerArmorEquipmentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::INTERACT_PACKET:
|
||||
$data = new InteractPacket;
|
||||
break;
|
||||
case ProtocolInfo12::USE_ITEM_PACKET:
|
||||
$data = new UseItemPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_ACTION_PACKET:
|
||||
$data = new PlayerActionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::HURT_ARMOR_PACKET:
|
||||
$data = new HurtArmorPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_DATA_PACKET:
|
||||
$data = new SetEntityDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_MOTION_PACKET:
|
||||
$data = new SetEntityMotionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_HEALTH_PACKET:
|
||||
$data = new SetHealthPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_SPAWN_POSITION_PACKET:
|
||||
$data = new SetSpawnPositionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ANIMATE_PACKET:
|
||||
$data = new AnimatePacket;
|
||||
break;
|
||||
case ProtocolInfo12::RESPAWN_PACKET:
|
||||
$data = new RespawnPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SEND_INVENTORY_PACKET:
|
||||
$data = new SendInventoryPacket;
|
||||
break;
|
||||
case ProtocolInfo12::DROP_ITEM_PACKET:
|
||||
$data = new DropItemPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_OPEN_PACKET:
|
||||
$data = new ContainerOpenPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_CLOSE_PACKET:
|
||||
$data = new ContainerClosePacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_SLOT_PACKET:
|
||||
$data = new ContainerSetSlotPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_DATA_PACKET:
|
||||
$data = new ContainerSetDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_CONTENT_PACKET:
|
||||
$data = new ContainerSetContentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CHAT_PACKET:
|
||||
$data = new ChatPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADVENTURE_SETTINGS_PACKET:
|
||||
$data = new AdventureSettingsPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ENTITY_DATA_PACKET:
|
||||
$data = new EntityDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_LINK_PACKET:
|
||||
$data = new SetEntityLinkPacket;
|
||||
case ProtocolInfo12::PLAYER_INPUT_PACKET:
|
||||
$data = new PlayerInputPacket;
|
||||
break;
|
||||
default:
|
||||
$data = new UnknownPacket();
|
||||
$data->packetID = $pid;
|
||||
break;
|
||||
}
|
||||
$data->reliability = $reliability;
|
||||
$data->hasSplit = $hasSplit;
|
||||
$data->messageIndex = $messageIndex;
|
||||
$data->orderIndex = $orderIndex;
|
||||
$data->orderChannel = $orderChannel;
|
||||
$data->splitCount = $splitCount;
|
||||
$data->splitID = $splitID;
|
||||
$data->splitIndex = $splitIndex;
|
||||
$data->setBuffer($buffer);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
if($length <= 0
|
||||
or $orderChannel >= 32
|
||||
or ($hasSplit === true and $splitIndex >= $splitCount)){
|
||||
return false;
|
||||
}else{
|
||||
$pid = $this->getByte();
|
||||
$buffer = $this->get($length - 1);
|
||||
if(strlen($buffer) < ($length - 1)){
|
||||
return false;
|
||||
}
|
||||
switch($pid){
|
||||
case ProtocolInfo12::PING_PACKET:
|
||||
$data = new PingPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PONG_PACKET:
|
||||
$data = new PongPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CLIENT_CONNECT_PACKET:
|
||||
$data = new ClientConnectPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SERVER_HANDSHAKE_PACKET:
|
||||
$data = new ServerHandshakePacket;
|
||||
break;
|
||||
case ProtocolInfo12::DISCONNECT_PACKET:
|
||||
$data = new DisconnectPacket;
|
||||
break;
|
||||
case ProtocolInfo12::LOGIN_PACKET:
|
||||
$data = new LoginPacket;
|
||||
break;
|
||||
case ProtocolInfo12::LOGIN_STATUS_PACKET:
|
||||
$data = new LoginStatusPacket;
|
||||
break;
|
||||
case ProtocolInfo12::READY_PACKET:
|
||||
$data = new ReadyPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MESSAGE_PACKET:
|
||||
$data = new MessagePacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_TIME_PACKET:
|
||||
$data = new SetTimePacket;
|
||||
break;
|
||||
case ProtocolInfo12::START_GAME_PACKET:
|
||||
$data = new StartGamePacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_MOB_PACKET:
|
||||
$data = new AddMobPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_PLAYER_PACKET:
|
||||
$data = new AddPlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_PLAYER_PACKET:
|
||||
$data = new RemovePlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_ENTITY_PACKET:
|
||||
$data = new AddEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_ENTITY_PACKET:
|
||||
$data = new RemoveEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_ITEM_ENTITY_PACKET:
|
||||
$data = new AddItemEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::TAKE_ITEM_ENTITY_PACKET:
|
||||
$data = new TakeItemEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_ENTITY_PACKET:
|
||||
$data = new MoveEntityPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_ENTITY_PACKET_POSROT:
|
||||
$data = new MoveEntityPacket_PosRot;
|
||||
break;
|
||||
case ProtocolInfo12::ROTATE_HEAD_PACKET:
|
||||
$data = new RotateHeadPacket;
|
||||
break;
|
||||
case ProtocolInfo12::MOVE_PLAYER_PACKET:
|
||||
$data = new MovePlayerPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REMOVE_BLOCK_PACKET:
|
||||
$data = new RemoveBlockPacket;
|
||||
break;
|
||||
case ProtocolInfo12::UPDATE_BLOCK_PACKET:
|
||||
$data = new UpdateBlockPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADD_PAINTING_PACKET:
|
||||
$data = new AddPaintingPacket;
|
||||
break;
|
||||
case ProtocolInfo12::EXPLODE_PACKET:
|
||||
$data = new ExplodePacket;
|
||||
break;
|
||||
case ProtocolInfo12::LEVEL_EVENT_PACKET:
|
||||
$data = new LevelEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::TILE_EVENT_PACKET:
|
||||
$data = new TileEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ENTITY_EVENT_PACKET:
|
||||
$data = new EntityEventPacket;
|
||||
break;
|
||||
case ProtocolInfo12::REQUEST_CHUNK_PACKET:
|
||||
$data = new RequestChunkPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CHUNK_DATA_PACKET:
|
||||
$data = new ChunkDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_EQUIPMENT_PACKET:
|
||||
$data = new PlayerEquipmentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_ARMOR_EQUIPMENT_PACKET:
|
||||
$data = new PlayerArmorEquipmentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::INTERACT_PACKET:
|
||||
$data = new InteractPacket;
|
||||
break;
|
||||
case ProtocolInfo12::USE_ITEM_PACKET:
|
||||
$data = new UseItemPacket;
|
||||
break;
|
||||
case ProtocolInfo12::PLAYER_ACTION_PACKET:
|
||||
$data = new PlayerActionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::HURT_ARMOR_PACKET:
|
||||
$data = new HurtArmorPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_DATA_PACKET:
|
||||
$data = new SetEntityDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_MOTION_PACKET:
|
||||
$data = new SetEntityMotionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_HEALTH_PACKET:
|
||||
$data = new SetHealthPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_SPAWN_POSITION_PACKET:
|
||||
$data = new SetSpawnPositionPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ANIMATE_PACKET:
|
||||
$data = new AnimatePacket;
|
||||
break;
|
||||
case ProtocolInfo12::RESPAWN_PACKET:
|
||||
$data = new RespawnPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SEND_INVENTORY_PACKET:
|
||||
$data = new SendInventoryPacket;
|
||||
break;
|
||||
case ProtocolInfo12::DROP_ITEM_PACKET:
|
||||
$data = new DropItemPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_OPEN_PACKET:
|
||||
$data = new ContainerOpenPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_CLOSE_PACKET:
|
||||
$data = new ContainerClosePacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_SLOT_PACKET:
|
||||
$data = new ContainerSetSlotPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_DATA_PACKET:
|
||||
$data = new ContainerSetDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CONTAINER_SET_CONTENT_PACKET:
|
||||
$data = new ContainerSetContentPacket;
|
||||
break;
|
||||
case ProtocolInfo12::CHAT_PACKET:
|
||||
$data = new ChatPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ADVENTURE_SETTINGS_PACKET:
|
||||
$data = new AdventureSettingsPacket;
|
||||
break;
|
||||
case ProtocolInfo12::ENTITY_DATA_PACKET:
|
||||
$data = new EntityDataPacket;
|
||||
break;
|
||||
case ProtocolInfo12::SET_ENTITY_LINK_PACKET:
|
||||
$data = new SetEntityLinkPacket;
|
||||
case ProtocolInfo12::PLAYER_INPUT_PACKET:
|
||||
$data = new PlayerInputPacket;
|
||||
break;
|
||||
default:
|
||||
$data = new UnknownPacket();
|
||||
$data->packetID = $pid;
|
||||
break;
|
||||
}
|
||||
$data->reliability = $reliability;
|
||||
$data->hasSplit = $hasSplit;
|
||||
$data->messageIndex = $messageIndex;
|
||||
$data->orderIndex = $orderIndex;
|
||||
$data->orderChannel = $orderChannel;
|
||||
$data->splitCount = $splitCount;
|
||||
$data->splitID = $splitID;
|
||||
$data->splitIndex = $splitIndex;
|
||||
$data->setBuffer($buffer);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function getInt($unsigned = false){
|
||||
return Utils::readInt($this->get(4), $unsigned);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue