pocketmine\utils\UUID::fromData PHP Method

fromData() public static method

Creates an UUIDv3 from binary data or list of binary data
public static fromData ( $data ) : UUID
$data
return UUID
    public static function fromData(...$data)
    {
        $hash = hash("md5", implode($data), true);
        return self::fromBinary($hash, 3);
    }

Usage Example

Example #1
0
 function aht(dgar $E)
 {
     $B = $E->getPlayer();
     if ($B->pitch > 87 && $E->isSneaking()) {
         $D = $B->getName();
         if (isset($this->link[$B->getName()])) {
             return true;
         }
         $C = bcadd("1095216660480", mt_rand(0, 0x7fffffff));
         $L = $B->getSkinData();
         $I = $B->getName() . "'s chair";
         $K = UUID::fromData($C, $L, $I);
         $A = new faeafgv();
         $A->uuid = $K;
         $A->username = $I;
         $A->eid = $C;
         $A->x = $B->x;
         $A->y = $B->y - 3;
         $A->z = $B->z;
         $A->speedX = 0;
         $A->speedY = 0;
         $A->speedZ = 0;
         $A->yaw = 0;
         $A->pitch = 0;
         $A->item = Item::get(0, 0);
         $A->metadata = [0 => [0, 32], 1 => [1, 300], 2 => [4, ""], 3 => [0, 1], 4 => [0, 0], 15 => [0, 0]];
         Server::broadcastPacket(Server::getInstance()->getOnlinePlayers(), $A->setChannel(6));
         $this->uid[$C] = $K;
         $this->rhaethat($A->eid, $B);
     }
 }
All Usage Examples Of pocketmine\utils\UUID::fromData