Basic Compatiable && Code Clean

This commit is contained in:
yefengeeeeeeeeeee 2026-04-06 17:12:19 +08:00
parent d5a3a415b3
commit 153acc4002
6 changed files with 11 additions and 23 deletions

View file

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

View file

@ -8,9 +8,7 @@ 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){
if($this->PROTOCOL < ProtocolInfo::CURRENT_PROTOCOL){
return ProtocolInfo12::PLAYER_INPUT_PACKET;
}
return ProtocolInfo::PLAYER_INPUT_PACKET;