Merge branch 'master' into multiversion

This commit is contained in:
yefengeeeeeeeeeee 2025-04-14 20:36:35 +08:00 • committed by GitHub
commit 3e438cf8ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 2123 additions and 1161 deletions

View file

@ -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;
}

View file

@ -4,6 +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;
}
return ProtocolInfo::ADVENTURE_SETTINGS_PACKET;
}

View file

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

View file

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

View file

@ -6,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;
}

View file

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

View file

@ -9,6 +9,13 @@ class ContainerOpenPacket extends RakNetDataPacket{
public $z;
public function pid(){
if($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;
}
@ -21,7 +28,7 @@ class ContainerOpenPacket extends RakNetDataPacket{
$this->putByte($this->windowid);
$this->putByte($this->type);
$this->putByte($this->slots);
$this->putInt($this->x);
$this->putInt($this->x);//String
$this->putInt($this->y);
$this->putInt($this->z);
}

View file

@ -6,6 +6,13 @@ class ContainerSetContentPacket extends RakNetDataPacket{
public $hotbar = array();
public function pid(){
if($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 ProtocolInfo::CONTAINER_SET_CONTENT_PACKET;
}
@ -31,7 +38,7 @@ class ContainerSetContentPacket extends RakNetDataPacket{
$this->putSlot($slot);
}
if($this->windowid === 0 and count($this->hotbar) > 0){
$this->putShort(count($this->hotbar));
$this->putShort(count($this->hotbar));//null
foreach($this->hotbar as $slot){
$this->putInt($slot);
}

View file

@ -6,6 +6,13 @@ class ContainerSetDataPacket extends RakNetDataPacket{
public $value;
public function pid(){
if($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 ProtocolInfo::CONTAINER_SET_DATA_PACKET;
}

View file

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

View file

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

View file

@ -7,6 +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;
}
return ProtocolInfo::ENTITY_DATA_PACKET;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -9,6 +9,11 @@ class InteractPacket extends RakNetDataPacket{
public $target;
public function pid(){
if($this->PROTOCOL < ProtocolInfo9::CURRENT_PROTOCOL_9){
return ProtocolInfo7::INTERACT_PACKET;
}elseif($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::INTERACT_PACKET;
}
return ProtocolInfo::INTERACT_PACKET;
}

View file

@ -12,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;
}

View file

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

View file

@ -9,13 +9,17 @@ class MessagePacket extends RakNetDataPacket{
}
public function decode(){
$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();
$this->putString($this->source);
if($this->PROTOCOL > ProtocolInfo9::CURRENT_PROTOCOL_9){ //0.6.1 and below From NostalgiaCore-BackPort Author:Gameherobrine
$this->putString($this->source);
}
$this->putString($this->message);
}

View file

@ -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;
}
@ -20,7 +23,9 @@ class MovePlayerPacket extends RakNetDataPacket{
$this->z = $this->getFloat();
$this->yaw = $this->getFloat();
$this->pitch = $this->getFloat();
$this->bodyYaw = $this->getFloat();
if($this->PROTOCOL > 13){
$this->bodyYaw = $this->getFloat();
}
}
public function encode(){
@ -31,7 +36,9 @@ class MovePlayerPacket extends RakNetDataPacket{
$this->putFloat($this->z);
$this->putFloat($this->yaw);
$this->putFloat($this->pitch);
$this->putFloat($this->bodyYaw);
if($this->PROTOCOL > 13){
$this->putFloat($this->bodyYaw);
}
}
}

View file

@ -0,0 +1,54 @@
<?php
class PlaceBlockPacket extends RakNetDataPacket{
public $unknown1 = 0;
public $unknown2 = 0;
public $unknown3 = 0;
public $unknown4 = 0;
public $unknown5 = 0;
public $unknown6 = 0;
public $unknown7 = 0;
public function pid(){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL) {
return ProtocolInfo12::PLACE_BLOCK_PACKET;
}
return ProtocolInfo::PLACE_BLOCK_PACKET;
}
public function decode(){
$this->unknown1 = $this->getInt();
$this->unknown2 = $this->getInt();
$this->unknown3 = $this->getInt();
$this->unknown4 = $this->getByte();
$this->unknown5 = $this->getByte();
$this->unknown6 = $this->getByte();
$this->unknown7 = $this->getByte();
ConsoleAPI::info("Int1:".$this->unknown1);
ConsoleAPI::info("Int2:".$this->unknown2);
ConsoleAPI::info("Int3:".$this->unknown3);
ConsoleAPI::info("Byte4:".$this->unknown4);
ConsoleAPI::info("Byte5:".$this->unknown5);
ConsoleAPI::info("Byte6:".$this->unknown6);
ConsoleAPI::info("Byte7:".$this->unknown7);
}
public function encode(){
$this->reset();
$this->putInt($this->unknown1);
$this->putInt($this->unknown2);
$this->putInt($this->unknown3);
$this->putByte($this->unknown4);
$this->putByte($this->unknown5);
$this->putByte($this->unknown6);
$this->putByte($this->unknown7);
ConsoleAPI::info("Int1:".$this->unknown1);
ConsoleAPI::info("Int2:".$this->unknown2);
ConsoleAPI::info("Int3:".$this->unknown3);
ConsoleAPI::info("Byte4:".$this->unknown4);
ConsoleAPI::info("Byte5:".$this->unknown5);
ConsoleAPI::info("Byte6:".$this->unknown6);
ConsoleAPI::info("Byte7:".$this->unknown7);
}
}

View file

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

View file

@ -5,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;
}

View file

@ -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;
}
@ -14,7 +17,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
$this->eid = $this->getInt();
$this->item = $this->getShort();
$this->meta = $this->getShort();
$this->slot = $this->getSignedByte();
if($this->PROTOCOL === ProtocolInfo::CURRENT_PROTOCOL){$this->slot = $this->getSignedByte();}
}
public function encode(){
@ -22,7 +25,7 @@ class PlayerEquipmentPacket extends RakNetDataPacket{
$this->putInt($this->eid);
$this->putShort($this->item);
$this->putShort($this->meta);
$this->putByte($this->slot);
if($this->PROTOCOL === ProtocolInfo::CURRENT_PROTOCOL){$this->putByte($this->slot);}
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

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

View file

@ -11,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;
}

View file

@ -7,6 +7,13 @@ class SendInventoryPacket extends RakNetDataPacket{
public $armor = array();
public function pid(){
if($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;
}
return ProtocolInfo::SEND_INVENTORY_PACKET;
}

View file

@ -5,6 +5,11 @@ class SetEntityDataPacket extends RakNetDataPacket{
public $metadata;
public function pid(){
if($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;
}
@ -14,6 +19,7 @@ class SetEntityDataPacket extends RakNetDataPacket{
public function encode(){
$this->reset();
if($this->PROTOCOL >= ProtocolInfo7::CURRENT_PROTOCOL_7)
$this->putInt($this->eid);
$this->put(Utils::writeMetadata($this->metadata));
}

View file

@ -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;
}

View file

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

View file

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

View file

@ -6,6 +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;
}
return ProtocolInfo::SET_SPAWN_POSITION_PACKET;
}

View file

@ -14,7 +14,7 @@ class SetTimePacket extends RakNetDataPacket{
public function encode(){
$this->reset();
$this->putInt($this->time);
$this->putInt($this->time);//long
$this->putByte($this->started ? 0x80:0x00);
}

View file

@ -19,7 +19,7 @@ class StartGamePacket extends RakNetDataPacket{
public function encode(){
$this->reset();
$this->putInt($this->seed);
$this->putInt($this->seed);//long
$this->putInt($this->generator);
$this->putInt($this->gamemode);
$this->putInt($this->eid);

View file

@ -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;
}

View file

@ -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;
}

View file

@ -16,6 +16,11 @@ class UseItemPacket extends RakNetDataPacket{
public $posZ;
public function pid(){
if($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;
}
@ -30,9 +35,11 @@ class UseItemPacket extends RakNetDataPacket{
$this->fx = $this->getFloat();
$this->fy = $this->getFloat();
$this->fz = $this->getFloat();
$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(){