feat: getProtocol()

This commit is contained in:
yefengeeeeeeeeeee 2026-07-13 19:20:47 +08:00
parent 896eb736f0
commit 5b4110b285
6 changed files with 41 additions and 12 deletions

View file

@ -665,7 +665,7 @@ class BlockAPI{
private function cancelAction(Block $block, Player $player, $send = true){
$player->addBlockUpdateIntoQueue($block->x, $block->y, $block->z, $block->getID(), $block->getMetadata());
if($send === true && $player->PROTOCOL >= ProtocolInfo12::CURRENT_PROTOCOL_11){
if($send === true && $player->getProtocol() >= ProtocolInfo12::CURRENT_PROTOCOL_11){
$player->sendInventory();
}
return false;

View file

@ -533,7 +533,7 @@ class PlayerAPI{
public static function decodeProtocol($ip, $port){
foreach(ServerAPI::request()->clients as $p) {
if($p->ip == $ip && $p->port == $port){
return $p->PROTOCOL;
return $p->getProtocol();
}
}
}