Drop pocketmine/uuid for ramsey/uuid

This commit is contained in:
Dylan K. Taylor
2021-03-16 23:03:00 +00:00
parent 6d622c4020
commit 72de45f0e9
24 changed files with 374 additions and 183 deletions

View File

@ -101,7 +101,6 @@ use pocketmine\permission\PermissibleDelegateTrait;
use pocketmine\Server;
use pocketmine\timings\Timings;
use pocketmine\utils\TextFormat;
use pocketmine\uuid\UUID;
use pocketmine\world\ChunkListener;
use pocketmine\world\ChunkListenerNoOpTrait;
use pocketmine\world\format\Chunk;
@ -110,6 +109,7 @@ use pocketmine\world\sound\EntityAttackNoDamageSound;
use pocketmine\world\sound\EntityAttackSound;
use pocketmine\world\sound\FireExtinguishSound;
use pocketmine\world\World;
use Ramsey\Uuid\UuidInterface;
use function abs;
use function assert;
use function count;
@ -397,7 +397,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
* as SimpleAuth for authentication. This is NOT SAFE anymore as this UUID is now what was given by the client, NOT
* a server-computed UUID.)
*/
public function getUniqueId() : UUID{
public function getUniqueId() : UuidInterface{
return parent::getUniqueId();
}
@ -471,14 +471,14 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
}
public function canSee(Player $player) : bool{
return !isset($this->hiddenPlayers[$player->getUniqueId()->toBinary()]);
return !isset($this->hiddenPlayers[$player->getUniqueId()->getBytes()]);
}
public function hidePlayer(Player $player) : void{
if($player === $this){
return;
}
$this->hiddenPlayers[$player->getUniqueId()->toBinary()] = true;
$this->hiddenPlayers[$player->getUniqueId()->getBytes()] = true;
$player->despawnFrom($this);
}
@ -486,7 +486,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
if($player === $this){
return;
}
unset($this->hiddenPlayers[$player->getUniqueId()->toBinary()]);
unset($this->hiddenPlayers[$player->getUniqueId()->getBytes()]);
if($player->isOnline()){
$player->spawnTo($this);
}