Sign (block): added setText() (#3100)

This commit is contained in:
Frago9876543210 2020-07-09 12:43:42 +00:00 committed by GitHub
parent 600ef033ab
commit c1a815a458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,6 +140,10 @@ class Sign extends Transparent{
return $this->text;
}
public function setText(SignText $text) : void{
$this->text = $text;
}
/**
* Called by the player controller (network session) to update the sign text, firing events as appropriate.
*
@ -160,7 +164,7 @@ class Sign extends Transparent{
}, $text->getLines())));
$ev->call();
if(!$ev->isCancelled()){
$this->text = clone $ev->getNewText();
$this->setText($ev->getNewText());
$this->pos->getWorld()->setBlock($this->pos, $this);
return true;
}