PocketMine-MP 5.33.2 git-919492bdcad8510eb6606439eb77e1c604f1d1ea
Loading...
Searching...
No Matches
SignChangeEvent.php
1<?php
2
3/*
4 *
5 * ____ _ _ __ __ _ __ __ ____
6 * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
7 * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
8 * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
9 * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
10 *
11 * This program is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation, either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * @author PocketMine Team
17 * @link http://www.pocketmine.net/
18 *
19 *
20 */
21
22declare(strict_types=1);
23
25
29use pocketmine\event\CancellableTrait;
31
35class SignChangeEvent extends BlockEvent implements Cancellable{
37
38 private SignText $oldText;
39
40 public function __construct(
41 private BaseSign $sign,
42 private Player $player,
43 private SignText $text,
44 private bool $frontFace = true
45 ){
46 $this->oldText = $this->sign->getFaceText($this->frontFace);
47 parent::__construct($sign);
48 }
49
50 public function getSign() : BaseSign{
51 return $this->sign;
52 }
53
54 public function getPlayer() : Player{
55 return $this->player;
56 }
57
61 public function getOldText() : SignText{
62 return $this->oldText;
63 }
64
68 public function getNewText() : SignText{
69 return $this->text;
70 }
71
75 public function setNewText(SignText $text) : void{
76 $this->text = $text;
77 }
78
79 public function isFrontFace() : bool{ return $this->frontFace; }
80}