Removed formatting on signs, allow OPs to use colored chat (or people with disabled remove format)

This commit is contained in:
Shoghi Cervantes 2015-04-13 16:45:20 +02:00
parent a993f15387
commit 547aa2ae31

View File

@ -1544,6 +1544,9 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
round($this->z, 4) round($this->z, 4)
])); ]));
if($this->isOp()){
$this->setRemoveFormat(false);
}
$this->orderChunks(); $this->orderChunks();
$this->sendNextChunk(); $this->sendNextChunk();
@ -2383,7 +2386,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$t->spawnTo($this); $t->spawnTo($this);
}else{ }else{
$ev = new SignChangeEvent($t->getBlock(), $this, [ $ev = new SignChangeEvent($t->getBlock(), $this, [
$nbt["Text1"], $nbt["Text2"], $nbt["Text3"], $nbt["Text4"] TextFormat::clean($nbt["Text1"], $this->removeFormat), TextFormat::clean($nbt["Text2"], $this->removeFormat), TextFormat::clean($nbt["Text3"], $this->removeFormat), TextFormat::clean($nbt["Text4"], $this->removeFormat)
]); ]);
if(!isset($t->namedtag->Creator) or $t->namedtag["Creator"] !== $this->username){ if(!isset($t->namedtag->Creator) or $t->namedtag["Creator"] !== $this->username){