"Creator" tag on signs may not exist

This commit is contained in:
Dylan K. Taylor 2017-10-17 13:35:31 +01:00
parent 68ac4f538f
commit 7f0a961526

View File

@ -155,7 +155,7 @@ class Sign extends Spawnable{
$ev = new SignChangeEvent($this->getBlock(), $player, array_map(function(string $line) use ($removeFormat){ return TextFormat::clean($line, $removeFormat); }, $lines)); $ev = new SignChangeEvent($this->getBlock(), $player, array_map(function(string $line) use ($removeFormat){ return TextFormat::clean($line, $removeFormat); }, $lines));
if(($creatorUUID = $this->namedtag->getString(self::TAG_CREATOR)) !== null and $creatorUUID !== $player->getRawUniqueId()){ if($this->namedtag->hasTag(self::TAG_CREATOR, StringTag::class) and $this->namedtag->getString(self::TAG_CREATOR) !== $player->getRawUniqueId()){
$ev->setCancelled(); $ev->setCancelled();
} }