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

@@ -92,7 +92,6 @@ use pocketmine\utils\Process;
use pocketmine\utils\Terminal;
use pocketmine\utils\TextFormat;
use pocketmine\utils\Utils;
use pocketmine\uuid\UUID;
use pocketmine\world\format\io\WorldProviderManager;
use pocketmine\world\format\io\WritableWorldProvider;
use pocketmine\world\generator\Generator;
@@ -100,6 +99,7 @@ use pocketmine\world\generator\GeneratorManager;
use pocketmine\world\generator\normal\Normal;
use pocketmine\world\World;
use pocketmine\world\WorldManager;
use Ramsey\Uuid\UuidInterface;
use function array_shift;
use function array_sum;
use function base64_encode;
@@ -254,7 +254,7 @@ class Server{
/** @var bool */
private $forceLanguage = false;
/** @var UUID */
/** @var UuidInterface */
private $serverID;
/** @var \DynamicClassLoader */
@@ -361,7 +361,7 @@ class Server{
}
/**
* @return UUID
* @return UuidInterface
*/
public function getServerUniqueId(){
return $this->serverID;
@@ -637,10 +637,10 @@ class Server{
}
/**
* Returns the player online with a UUID equivalent to the specified UUID object, or null if not found
* Returns the player online with a UUID equivalent to the specified UuidInterface object, or null if not found
*/
public function getPlayerByUUID(UUID $uuid) : ?Player{
return $this->getPlayerByRawUUID($uuid->toBinary());
public function getPlayerByUUID(UuidInterface $uuid) : ?Player{
return $this->getPlayerByRawUUID($uuid->getBytes());
}
public function getConfigGroup() : ServerConfigGroup{
@@ -1540,7 +1540,7 @@ class Server{
foreach($this->playerList as $p){
$p->getNetworkSession()->onPlayerAdded($player);
}
$rawUUID = $player->getUniqueId()->toBinary();
$rawUUID = $player->getUniqueId()->getBytes();
$this->playerList[$rawUUID] = $player;
if($this->sendUsageTicker > 0){
@@ -1549,7 +1549,7 @@ class Server{
}
public function removeOnlinePlayer(Player $player) : void{
if(isset($this->playerList[$rawUUID = $player->getUniqueId()->toBinary()])){
if(isset($this->playerList[$rawUUID = $player->getUniqueId()->getBytes()])){
unset($this->playerList[$rawUUID]);
foreach($this->playerList as $p){
$p->getNetworkSession()->onPlayerRemoved($player);

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{

View File

@@ -35,10 +35,9 @@ use pocketmine\network\mcpe\protocol\types\recipe\ShapelessRecipe as ProtocolSha
use pocketmine\timings\Timings;
use pocketmine\utils\Binary;
use pocketmine\utils\SingletonTrait;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\Uuid;
use function array_map;
use function spl_object_id;
use function str_repeat;
final class CraftingDataCache{
use SingletonTrait;
@@ -72,7 +71,7 @@ final class CraftingDataCache{
$pk->cleanRecipes = true;
$counter = 0;
$nullUUID = UUID::fromData(str_repeat("\x00", 16));
$nullUUID = Uuid::fromString(Uuid::NIL);
$converter = TypeConverter::getInstance();
foreach($manager->getShapelessRecipes() as $list){
foreach($list as $recipe){

View File

@@ -43,7 +43,7 @@ use pocketmine\player\Player;
use pocketmine\player\PlayerInfo;
use pocketmine\player\XboxLivePlayerInfo;
use pocketmine\Server;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\Uuid;
use function is_array;
/**
@@ -112,11 +112,10 @@ class LoginPacketHandler extends PacketHandler{
return true;
}
try{
$uuid = UUID::fromString($extraData->identity);
}catch(\InvalidArgumentException $e){
throw BadPacketException::wrap($e, "Failed to parse login UUID");
if(!Uuid::isValid($extraData->identity)){
throw new BadPacketException("Invalid login UUID");
}
$uuid = Uuid::fromString($extraData->identity);
if($extraData->XUID !== ""){
$playerInfo = new XboxLivePlayerInfo(
$extraData->XUID,

View File

@@ -31,13 +31,13 @@ use pocketmine\network\mcpe\protocol\types\DeviceOS;
use pocketmine\network\mcpe\protocol\types\entity\EntityLink;
use pocketmine\network\mcpe\protocol\types\entity\MetadataProperty;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
class AddPlayerPacket extends DataPacket implements ClientboundPacket{
public const NETWORK_ID = ProtocolInfo::ADD_PLAYER_PACKET;
/** @var UUID */
/** @var UuidInterface */
public $uuid;
/** @var string */
public $username;

View File

@@ -27,7 +27,7 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
class CraftingEventPacket extends DataPacket implements ServerboundPacket{
@@ -37,7 +37,7 @@ class CraftingEventPacket extends DataPacket implements ServerboundPacket{
public $windowId;
/** @var int */
public $type;
/** @var UUID */
/** @var UuidInterface */
public $id;
/** @var ItemStack[] */
public $input = [];

View File

@@ -26,7 +26,7 @@ namespace pocketmine\network\mcpe\protocol;
#include <rules/DataPacket.h>
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
class EmoteListPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
@@ -34,11 +34,11 @@ class EmoteListPacket extends DataPacket implements ClientboundPacket, Serverbou
/** @var int */
private $playerEntityRuntimeId;
/** @var UUID[] */
/** @var UuidInterface[] */
private $emoteIds;
/**
* @param UUID[] $emoteIds
* @param UuidInterface[] $emoteIds
*/
public static function create(int $playerEntityRuntimeId, array $emoteIds) : self{
$result = new self;
@@ -49,7 +49,7 @@ class EmoteListPacket extends DataPacket implements ClientboundPacket, Serverbou
public function getPlayerEntityRuntimeId() : int{ return $this->playerEntityRuntimeId; }
/** @return UUID[] */
/** @return UuidInterface[] */
public function getEmoteIds() : array{ return $this->emoteIds; }
protected function decodePayload(PacketSerializer $in) : void{

View File

@@ -27,12 +27,12 @@ namespace pocketmine\network\mcpe\protocol;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\network\mcpe\protocol\types\skin\SkinData;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
class PlayerSkinPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{
public const NETWORK_ID = ProtocolInfo::PLAYER_SKIN_PACKET;
/** @var UUID */
/** @var UuidInterface */
public $uuid;
/** @var string */
public $oldSkinName = "";
@@ -41,7 +41,7 @@ class PlayerSkinPacket extends DataPacket implements ClientboundPacket, Serverbo
/** @var SkinData */
public $skin;
public static function create(UUID $uuid, SkinData $skinData) : self{
public static function create(UuidInterface $uuid, SkinData $skinData) : self{
$result = new self;
$result->uuid = $uuid;
$result->skin = $skinData;

View File

@@ -60,9 +60,11 @@ use pocketmine\network\mcpe\protocol\types\StructureEditorData;
use pocketmine\network\mcpe\protocol\types\StructureSettings;
use pocketmine\utils\BinaryDataException;
use pocketmine\utils\BinaryStream;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
use function strlen;
use function strrev;
use function substr;
class PacketSerializer extends BinaryStream{
@@ -81,21 +83,17 @@ class PacketSerializer extends BinaryStream{
/**
* @throws BinaryDataException
*/
public function getUUID() : UUID{
//This is actually two little-endian longs: UUID Most followed by UUID Least
$part1 = $this->getLInt();
$part0 = $this->getLInt();
$part3 = $this->getLInt();
$part2 = $this->getLInt();
return new UUID($part0, $part1, $part2, $part3);
public function getUUID() : UuidInterface{
//This is two little-endian longs: bytes 7-0 followed by bytes 15-8
$p1 = strrev($this->get(8));
$p2 = strrev($this->get(8));
return \Ramsey\Uuid\Uuid::fromBytes($p1 . $p2);
}
public function putUUID(UUID $uuid) : void{
$this->putLInt($uuid->getPart(1));
$this->putLInt($uuid->getPart(0));
$this->putLInt($uuid->getPart(3));
$this->putLInt($uuid->getPart(2));
public function putUUID(UuidInterface $uuid) : void{
$bytes = $uuid->getBytes();
$this->put(strrev(substr($bytes, 0, 8)));
$this->put(strrev(substr($bytes, 8, 8)));
}
public function getSkin() : SkinData{

View File

@@ -24,11 +24,11 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types;
use pocketmine\network\mcpe\protocol\types\skin\SkinData;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
class PlayerListEntry{
/** @var UUID */
/** @var UuidInterface */
public $uuid;
/** @var int */
public $entityUniqueId;
@@ -47,14 +47,14 @@ class PlayerListEntry{
/** @var bool */
public $isHost = false;
public static function createRemovalEntry(UUID $uuid) : PlayerListEntry{
public static function createRemovalEntry(UuidInterface $uuid) : PlayerListEntry{
$entry = new PlayerListEntry();
$entry->uuid = $uuid;
return $entry;
}
public static function createAdditionEntry(UUID $uuid, int $entityUniqueId, string $username, SkinData $skinData, string $xboxUserId = "", string $platformChatId = "", int $buildPlatform = -1, bool $isTeacher = false, bool $isHost = false) : PlayerListEntry{
public static function createAdditionEntry(UuidInterface $uuid, int $entityUniqueId, string $username, SkinData $skinData, string $xboxUserId = "", string $platformChatId = "", int $buildPlatform = -1, bool $isTeacher = false, bool $isHost = false) : PlayerListEntry{
$entry = new PlayerListEntry();
$entry->uuid = $uuid;
$entry->entityUniqueId = $entityUniqueId;

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types\command;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
class CommandOriginData{
public const ORIGIN_PLAYER = 0;
@@ -41,7 +41,7 @@ class CommandOriginData{
/** @var int */
public $type;
/** @var UUID */
/** @var UuidInterface */
public $uuid;
/** @var string */

View File

@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types\recipe;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
final class MultiRecipe extends RecipeWithTypeId{
@@ -41,18 +41,18 @@ final class MultiRecipe extends RecipeWithTypeId{
public const TYPE_FIREWORKS = "00000000-0000-0000-0000-000000000002";
public const TYPE_MAP_LOCKING_CARTOGRAPHY = "602234E4-CAC1-4353-8BB7-B1EBFF70024B";
/** @var UUID */
/** @var UuidInterface */
private $recipeId;
/** @var int */
private $recipeNetId;
public function __construct(int $typeId, UUID $recipeId, int $recipeNetId){
public function __construct(int $typeId, UuidInterface $recipeId, int $recipeNetId){
parent::__construct($typeId);
$this->recipeId = $recipeId;
$this->recipeNetId = $recipeNetId;
}
public function getRecipeId() : UUID{
public function getRecipeId() : UuidInterface{
return $this->recipeId;
}

View File

@@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol\types\recipe;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
final class ShapedRecipe extends RecipeWithTypeId{
@@ -36,7 +36,7 @@ final class ShapedRecipe extends RecipeWithTypeId{
private $input;
/** @var ItemStack[] */
private $output;
/** @var UUID */
/** @var UuidInterface */
private $uuid;
/** @var string */
private $blockName;
@@ -49,7 +49,7 @@ final class ShapedRecipe extends RecipeWithTypeId{
* @param RecipeIngredient[][] $input
* @param ItemStack[] $output
*/
public function __construct(int $typeId, string $recipeId, array $input, array $output, UUID $uuid, string $blockType, int $priority, int $recipeNetId){
public function __construct(int $typeId, string $recipeId, array $input, array $output, UuidInterface $uuid, string $blockType, int $priority, int $recipeNetId){
parent::__construct($typeId);
$rows = count($input);
if($rows < 1 or $rows > 3){
@@ -98,7 +98,7 @@ final class ShapedRecipe extends RecipeWithTypeId{
return $this->output;
}
public function getUuid() : UUID{
public function getUuid() : UuidInterface{
return $this->uuid;
}

View File

@@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\protocol\types\recipe;
use pocketmine\network\mcpe\protocol\serializer\PacketSerializer;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
use function count;
final class ShapelessRecipe extends RecipeWithTypeId{
@@ -36,7 +36,7 @@ final class ShapelessRecipe extends RecipeWithTypeId{
private $inputs;
/** @var ItemStack[] */
private $outputs;
/** @var UUID */
/** @var UuidInterface */
private $uuid;
/** @var string */
private $blockName;
@@ -49,7 +49,7 @@ final class ShapelessRecipe extends RecipeWithTypeId{
* @param RecipeIngredient[] $inputs
* @param ItemStack[] $outputs
*/
public function __construct(int $typeId, string $recipeId, array $inputs, array $outputs, UUID $uuid, string $blockName, int $priority, int $recipeNetId){
public function __construct(int $typeId, string $recipeId, array $inputs, array $outputs, UuidInterface $uuid, string $blockName, int $priority, int $recipeNetId){
parent::__construct($typeId);
$this->recipeId = $recipeId;
$this->inputs = $inputs;
@@ -78,7 +78,7 @@ final class ShapelessRecipe extends RecipeWithTypeId{
return $this->outputs;
}
public function getUuid() : UUID{
public function getUuid() : UuidInterface{
return $this->uuid;
}

View File

@@ -23,7 +23,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types\skin;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\Uuid;
class SkinData{
@@ -86,7 +86,7 @@ class SkinData{
$this->personaCapeOnClassic = $personaCapeOnClassic;
$this->capeId = $capeId;
//this has to be unique or the client will do stupid things
$this->fullSkinId = $fullSkinId ?? UUID::fromRandom()->toString();
$this->fullSkinId = $fullSkinId ?? Uuid::uuid4()->toString();
$this->armSize = $armSize;
$this->skinColor = $skinColor;
$this->personaPieces = $personaPieces;

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

View File

@@ -25,7 +25,7 @@ namespace pocketmine\player;
use pocketmine\entity\Skin;
use pocketmine\utils\TextFormat;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
/**
* Encapsulates data needed to create a player.
@@ -34,7 +34,7 @@ class PlayerInfo{
/** @var string */
private $username;
/** @var UUID */
/** @var UuidInterface */
private $uuid;
/** @var Skin */
private $skin;
@@ -50,7 +50,7 @@ class PlayerInfo{
* @param mixed[] $extraData
* @phpstan-param array<string, mixed> $extraData
*/
public function __construct(string $username, UUID $uuid, Skin $skin, string $locale, array $extraData = []){
public function __construct(string $username, UuidInterface $uuid, Skin $skin, string $locale, array $extraData = []){
$this->username = TextFormat::clean($username);
$this->uuid = $uuid;
$this->skin = $skin;
@@ -62,7 +62,7 @@ class PlayerInfo{
return $this->username;
}
public function getUuid() : UUID{
public function getUuid() : UuidInterface{
return $this->uuid;
}

View File

@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace pocketmine\player;
use pocketmine\entity\Skin;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\UuidInterface;
/**
* Encapsulates player info specific to players who are authenticated with XBOX Live.
@@ -34,7 +34,7 @@ final class XboxLivePlayerInfo extends PlayerInfo{
/** @var string */
private $xuid;
public function __construct(string $xuid, string $username, UUID $uuid, Skin $skin, string $locale, array $extraData = []){
public function __construct(string $xuid, string $username, UuidInterface $uuid, Skin $skin, string $locale, array $extraData = []){
parent::__construct($username, $uuid, $skin, $locale, $extraData);
$this->xuid = $xuid;
}

View File

@@ -31,8 +31,8 @@ use pocketmine\utils\AssumptionFailedError;
use pocketmine\utils\Internet;
use pocketmine\utils\Process;
use pocketmine\utils\Utils;
use pocketmine\uuid\UUID;
use pocketmine\VersionInfo;
use Ramsey\Uuid\Uuid;
use function array_map;
use function array_values;
use function count;
@@ -65,7 +65,7 @@ class SendUsageTask extends AsyncTask{
$data = [];
$data["uniqueServerId"] = $server->getServerUniqueId()->toString();
$data["uniqueMachineId"] = Utils::getMachineUniqueId()->toString();
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId()->toString(), microtime(false))->toString();
$data["uniqueRequestId"] = Uuid::uuid3($server->getServerUniqueId()->toString(), microtime(false))->toString();
switch($type){
case self::TYPE_OPEN:
@@ -127,7 +127,7 @@ class SendUsageTask extends AsyncTask{
$playerList[$k] = md5($v);
}
$players = array_map(function(Player $p) : string{ return md5($p->getUniqueId()->toBinary()); }, $server->getOnlinePlayers());
$players = array_map(function(Player $p) : string{ return md5($p->getUniqueId()->getBytes()); }, $server->getOnlinePlayers());
$data["players"] = [
"count" => count($players),

View File

@@ -28,7 +28,8 @@ declare(strict_types=1);
namespace pocketmine\utils;
use DaveRandom\CallbackValidator\CallbackType;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use function array_combine;
use function array_map;
use function array_reverse;
@@ -93,7 +94,7 @@ final class Utils{
/** @var string|null */
private static $os;
/** @var UUID|null */
/** @var UuidInterface|null */
private static $serverUniqueId = null;
/**
@@ -178,7 +179,7 @@ final class Utils{
*
* @param string $extra optional, additional data to identify the machine
*/
public static function getMachineUniqueId(string $extra = "") : UUID{
public static function getMachineUniqueId(string $extra = "") : UuidInterface{
if(self::$serverUniqueId !== null and $extra === ""){
return self::$serverUniqueId;
}
@@ -234,7 +235,8 @@ final class Utils{
$data .= $ext . ":" . phpversion($ext);
}
$uuid = UUID::fromData($machine, $data);
//TODO: use of NIL as namespace is a hack; it works for now, but we should have a proper namespace UUID
$uuid = Uuid::uuid3(Uuid::NIL, $data);
if($extra === ""){
self::$serverUniqueId = $uuid;

View File

@@ -36,7 +36,7 @@ use pocketmine\network\mcpe\protocol\types\entity\FloatMetadataProperty;
use pocketmine\network\mcpe\protocol\types\entity\LongMetadataProperty;
use pocketmine\network\mcpe\protocol\types\inventory\ItemStack;
use pocketmine\network\mcpe\protocol\types\PlayerListEntry;
use pocketmine\uuid\UUID;
use Ramsey\Uuid\Uuid;
use function str_repeat;
class FloatingTextParticle implements Particle{
@@ -90,7 +90,7 @@ class FloatingTextParticle implements Particle{
}
if(!$this->invisible){
$uuid = UUID::fromRandom();
$uuid = Uuid::uuid4();
$name = $this->title . ($this->text !== "" ? "\n" . $this->text : "");
$p[] = PlayerListPacket::add([PlayerListEntry::createAdditionEntry($uuid, $this->entityId, $name, SkinAdapterSingleton::get()->toSkinData(new Skin("Standard_Custom", str_repeat("\x00", 8192))))]);