Fixed UUID-related issues

This commit is contained in:
Dylan K. Taylor 2017-06-07 13:11:03 +01:00
parent 75863e2a44
commit e18a3ac933
4 changed files with 6 additions and 3 deletions

View File

@ -366,6 +366,9 @@ class Server{
return $this->getConfigString("server-ip", "0.0.0.0");
}
/**
* @return UUID
*/
public function getServerUniqueId(){
return $this->serverID;
}

View File

@ -293,7 +293,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
$this->setSkin($this->namedtag->Skin["Data"], $this->namedtag->Skin["Name"]);
}
$this->uuid = UUID::fromData($this->getId(), $this->getSkinData(), $this->getNameTag());
$this->uuid = UUID::fromData((string) $this->getId(), $this->getSkinData(), $this->getNameTag());
}
if(isset($this->namedtag->Inventory) and $this->namedtag->Inventory instanceof ListTag){

View File

@ -297,7 +297,7 @@ class CraftingManager{
* @param Recipe $recipe
*/
public function registerRecipe(Recipe $recipe){
$recipe->setId(UUID::fromData(++self::$RECIPE_COUNT, $recipe->getResult()->getId(), $recipe->getResult()->getDamage(), $recipe->getResult()->getCount(), $recipe->getResult()->getCompoundTag()));
$recipe->setId(UUID::fromData((string) ++self::$RECIPE_COUNT, (string) $recipe->getResult()->getId(), (string) $recipe->getResult()->getDamage(), (string) $recipe->getResult()->getCount(), $recipe->getResult()->getCompoundTag()));
if($recipe instanceof ShapedRecipe){
$this->registerShapedRecipe($recipe);

View File

@ -44,7 +44,7 @@ class SendUsageTask extends AsyncTask{
$data = [];
$data["uniqueServerId"] = $server->getServerUniqueId()->toString();
$data["uniqueMachineId"] = Utils::getMachineUniqueId()->toString();
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId(), microtime(true))->toString();
$data["uniqueRequestId"] = UUID::fromData($server->getServerUniqueId()->toString(), microtime(false))->toString();
switch($type){
case self::TYPE_OPEN: