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

@@ -55,8 +55,9 @@ use pocketmine\network\mcpe\protocol\types\entity\StringMetadataProperty;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\player\Player;
use pocketmine\utils\Limits;
use pocketmine\uuid\UUID;
use pocketmine\world\sound\TotemUseSound;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use function array_filter;
use function array_key_exists;
use function array_merge;
@@ -74,7 +75,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
/** @var EnderChestInventory */
protected $enderChestInventory;
/** @var UUID */
/** @var UuidInterface */
protected $uuid;
/** @var Skin */
@@ -113,7 +114,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
);
}
public function getUniqueId() : UUID{
public function getUniqueId() : UuidInterface{
return $this->uuid;
}
@@ -203,7 +204,8 @@ class Human extends Living implements ProjectileSource, InventoryHolder{
$this->setNameTag($nameTagTag->getValue());
}
$this->uuid = UUID::fromData((string) $this->getId(), $this->skin->getSkinData(), $this->getNameTag());
//TODO: use of NIL UUID for namespace is a hack; we should provide a proper UUID for the namespace
$this->uuid = Uuid::uuid3(Uuid::NIL, ((string) $this->getId()) . $this->skin->getSkinData() . $this->getNameTag());
}
protected function initEntity(CompoundTag $nbt) : void{