mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Support 0.7.6
This commit is contained in:
parent
3580b884d8
commit
3d8bb7df05
40 changed files with 1377 additions and 12 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
NostalgiaCore is a fork of Legacy PocketMine-MP 1.3.12, which fixes bugs of Legacy PocketMine-MP, and adds new content
|
||||
|
||||
Supported MCPE versions: 0.8.0, 0.8.1 (maybe 0.8.2)
|
||||
Supported MCPE versions: 0.7.4, 0.7.6, 0.8.0, 0.8.1 (maybe 0.8.2)
|
||||
|
||||
(Special thx to GullCraft Network and DartMiner43)
|
||||
|
||||
|
|
|
|||
1100
src/Player.php
1100
src/Player.php
File diff suppressed because it is too large
Load diff
|
|
@ -78,6 +78,146 @@ abstract class ProtocolInfo{
|
|||
* 0x17
|
||||
* 0x14
|
||||
*/
|
||||
abstract class ProtocolInfo12{
|
||||
|
||||
const CURRENT_PROTOCOL_12 = 12;
|
||||
|
||||
const PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 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 MOVE_ENTITY_PACKET_POSROT = 0x93;
|
||||
const ROTATE_HEAD_PACKET = 0xff;
|
||||
const MOVE_PLAYER_PACKET = 0x94;
|
||||
//const PLACE_BLOCK_PACKET = 0x96;
|
||||
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 = 0xb5; //Bruh
|
||||
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 PING_PACKET = 0x00;
|
||||
|
||||
const PONG_PACKET = 0x03;
|
||||
|
||||
const CLIENT_CONNECT_PACKET = 0x09;
|
||||
const SERVER_HANDSHAKE_PACKET = 0x10;
|
||||
|
||||
const CLIENT_HANDSHAKE_PACKET = 0x13;
|
||||
//const SERVER_FULL_PACKET = 0x14;
|
||||
const DISCONNECT_PACKET = 0x15;
|
||||
const LOGIN_PACKET = 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 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;
|
||||
|
||||
}
|
||||
/***REM_START***/
|
||||
require_once(FILE_PATH . "src/network/raknet/RakNetDataPacket.php");
|
||||
/***REM_END***/
|
||||
|
|
@ -9,6 +9,9 @@ class AddPaintingPacket extends RakNetDataPacket{
|
|||
public $title;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ADD_PAINTING_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ADD_PAINTING_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ class AdventureSettingsPacket extends RakNetDataPacket{
|
|||
public $flags;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +8,11 @@ class AnimatePacket extends RakNetDataPacket{
|
|||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +4,11 @@ class ChatPacket extends RakNetDataPacket{
|
|||
public $message;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +6,9 @@ class ChunkDataPacket extends RakNetDataPacket{
|
|||
public $data;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::CHUNK_DATA_PACKET;
|
||||
}
|
||||
return ProtocolInfo::CHUNK_DATA_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ class ContainerClosePacket extends RakNetDataPacket{
|
|||
public $windowid;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +9,11 @@ class ContainerOpenPacket extends RakNetDataPacket{
|
|||
public $z;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +6,11 @@ class ContainerSetContentPacket extends RakNetDataPacket{
|
|||
public $hotbar = array();
|
||||
|
||||
public function pid(){
|
||||
if($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 ProtocolInfo::CONTAINER_SET_CONTENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ class ContainerSetDataPacket extends RakNetDataPacket{
|
|||
public $value;
|
||||
|
||||
public function pid(){
|
||||
if($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 ProtocolInfo::CONTAINER_SET_DATA_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ class ContainerSetSlotPacket extends RakNetDataPacket{
|
|||
public $item;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +6,11 @@ class DropItemPacket extends RakNetDataPacket{
|
|||
public $item;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
return ProtocolInfo9::DROP_ITEM_PACKET;
|
||||
}else if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::DROP_ITEM_PACKET;
|
||||
}
|
||||
return ProtocolInfo::DROP_ITEM_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ class EntityDataPacket extends RakNetDataPacket{
|
|||
public $namedtag;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +14,9 @@ class EntityEventPacket extends RakNetDataPacket{
|
|||
}
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ENTITY_EVENT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ENTITY_EVENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ class ExplodePacket extends RakNetDataPacket{
|
|||
public $records;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::EXPLODE_PACKET;
|
||||
}
|
||||
return ProtocolInfo::EXPLODE_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,9 @@ class HurtArmorPacket extends RakNetDataPacket{
|
|||
public $health;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::HURT_ARMOR_PACKET;
|
||||
}
|
||||
return ProtocolInfo::HURT_ARMOR_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ class InteractPacket extends RakNetDataPacket{
|
|||
public $target;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::INTERACT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::INTERACT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ class LevelEventPacket extends RakNetDataPacket{
|
|||
public $data;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::LEVEL_EVENT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::LEVEL_EVENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class LoginPacket extends RakNetDataPacket{
|
|||
$this->protocol2 = $this->getInt();
|
||||
$this->clientId = $this->getInt();
|
||||
$this->loginData = $this->getString();
|
||||
$this->PROTOCOL = $this->protocol1;
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ class MovePlayerPacket extends RakNetDataPacket{
|
|||
public $bodyYaw;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::MOVE_PLAYER_PACKET;
|
||||
}
|
||||
return ProtocolInfo::MOVE_PLAYER_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ class PlayerActionPacket extends RakNetDataPacket{
|
|||
public $eid;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::PLAYER_ACTION_PACKET;
|
||||
}
|
||||
return ProtocolInfo::PLAYER_ACTION_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class PlayerArmorEquipmentPacket extends RakNetDataPacket{
|
|||
public $slots = array();
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::PLAYER_ARMOR_EQUIPMENT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::PLAYER_ARMOR_EQUIPMENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
|
|||
public $slot;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::PLAYER_EQUIPMENT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::PLAYER_EQUIPMENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
<?php
|
||||
class PlayerInputPacket extends RakNetDataPacket{
|
||||
|
||||
public $moveStrafe, $moveForward, $isJumping, $isSneaking;
|
||||
public function encode()
|
||||
{
|
||||
|
||||
public function encode(){
|
||||
|
||||
}
|
||||
|
||||
public function pid()
|
||||
{
|
||||
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;
|
||||
}
|
||||
return ProtocolInfo::PLAYER_INPUT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ class RemoveBlockPacket extends RakNetDataPacket{
|
|||
public $z;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::REMOVE_BLOCK_PACKET;
|
||||
}
|
||||
return ProtocolInfo::REMOVE_BLOCK_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class RequestChunkPacket extends RakNetDataPacket{
|
|||
public $chunkZ;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::REQUEST_CHUNK_PACKET;
|
||||
}
|
||||
return ProtocolInfo::REQUEST_CHUNK_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ class RespawnPacket extends RakNetDataPacket{
|
|||
public $z;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +11,9 @@ class RotateHeadPacket extends RakNetDataPacket{
|
|||
*/
|
||||
public $rawYaw = false;
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::ROTATE_HEAD_PACKET;
|
||||
}
|
||||
return ProtocolInfo::ROTATE_HEAD_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@ class SendInventoryPacket extends RakNetDataPacket{
|
|||
public $armor = array();
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo12::CURRENT_PROTOCOL_12){
|
||||
return ProtocolInfo9::SEND_INVENTORY_PACKET;
|
||||
}else if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SEND_INVENTORY_PACKET;
|
||||
}
|
||||
return ProtocolInfo::SEND_INVENTORY_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ class SetEntityDataPacket extends RakNetDataPacket{
|
|||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SET_ENTITY_DATA_PACKET;
|
||||
}
|
||||
return ProtocolInfo::SET_ENTITY_DATA_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ class SetEntityLinkPacket extends RakNetDataPacket{
|
|||
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SET_ENTITY_LINK_PACKET;
|
||||
}
|
||||
return ProtocolInfo::SET_ENTITY_LINK_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ class SetEntityMotionPacket extends RakNetDataPacket{
|
|||
public $speedZ;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::SET_ENTITY_MOTION_PACKET;
|
||||
}
|
||||
return ProtocolInfo::SET_ENTITY_MOTION_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ class SetHealthPacket extends RakNetDataPacket{
|
|||
public $health;
|
||||
|
||||
public function pid(){
|
||||
if($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,6 +6,11 @@ class SetSpawnPositionPacket extends RakNetDataPacket{
|
|||
public $y;
|
||||
|
||||
public function pid(){
|
||||
if($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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ class TileEventPacket extends RakNetDataPacket{
|
|||
public $case2;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::TILE_EVENT_PACKET;
|
||||
}
|
||||
return ProtocolInfo::TILE_EVENT_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@ class UpdateBlockPacket extends RakNetDataPacket{
|
|||
public $meta;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::UPDATE_BLOCK_PACKET;
|
||||
}
|
||||
return ProtocolInfo::UPDATE_BLOCK_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ class UseItemPacket extends RakNetDataPacket{
|
|||
public $posZ;
|
||||
|
||||
public function pid(){
|
||||
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
return ProtocolInfo12::USE_ITEM_PACKET;
|
||||
}
|
||||
return ProtocolInfo::USE_ITEM_PACKET;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@ abstract class RakNetDataPacket extends stdClass{
|
|||
public $splitCount;
|
||||
public $splitID;
|
||||
public $splitIndex;
|
||||
|
||||
private $offset = 0;
|
||||
|
||||
public $PROTOCOL = 14;
|
||||
|
||||
abstract public function encode();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue