mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 02:09:42 +00:00
Sign (block): added setText() (#3100)
This commit is contained in:
parent
600ef033ab
commit
c1a815a458
@ -140,6 +140,10 @@ class Sign extends Transparent{
|
|||||||
return $this->text;
|
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.
|
* 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())));
|
}, $text->getLines())));
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$this->text = clone $ev->getNewText();
|
$this->setText($ev->getNewText());
|
||||||
$this->pos->getWorld()->setBlock($this->pos, $this);
|
$this->pos->getWorld()->setBlock($this->pos, $this);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user