|
| __construct (Level $level, CompoundTag $nbt) |
|
| saveNBT () |
|
| setText ($line1="", $line2="", $line3="", $line4="") |
|
| getText () |
|
| getSpawnCompound () |
|
| updateCompoundTag (CompoundTag $nbt, Player $player) |
|
| spawnTo (Player $player) |
|
| __construct (Level $level, CompoundTag $nbt) |
|
| spawnToAll () |
|
| getSpawnCompound () |
|
| updateCompoundTag (CompoundTag $nbt, Player $player) |
|
| getSaveId () |
|
| __construct (Level $level, CompoundTag $nbt) |
|
| getId () |
|
| saveNBT () |
|
| getBlock () |
|
| onUpdate () |
|
| scheduleUpdate () |
|
| __destruct () |
|
| close () |
|
| getName () |
|
| __construct ($x=0, $y=0, $z=0, Level $level=null) |
|
| asPosition () |
|
| add ($x, $y=0, $z=0) |
|
| getLevel () |
|
| setLevel (Level $level=null) |
|
| isValid () |
|
| getSide ($side, $step=1) |
|
| __toString () |
|
| setComponents ($x, $y, $z) |
|
| fromObjectAdd (Vector3 $pos, $x, $y, $z) |
|
| __construct ($x=0, $y=0, $z=0) |
|
| getX () |
|
| getY () |
|
| getZ () |
|
| getFloorX () |
|
| getFloorY () |
|
| getFloorZ () |
|
| getRight () |
|
| getUp () |
|
| getForward () |
|
| getSouth () |
|
| getWest () |
|
| add ($x, $y=0, $z=0) |
|
| subtract ($x=0, $y=0, $z=0) |
|
| multiply ($number) |
|
| divide ($number) |
|
| ceil () |
|
| floor () |
|
| round () |
|
| abs () |
|
| getSide ($side, $step=1) |
|
| asVector3 () |
|
| distance (Vector3 $pos) |
|
| distanceSquared (Vector3 $pos) |
|
| maxPlainDistance ($x=0, $z=0) |
|
| length () |
|
| lengthSquared () |
|
| normalize () |
|
| dot (Vector3 $v) |
|
| cross (Vector3 $v) |
|
| equals (Vector3 $v) |
|
| getIntermediateWithXValue (Vector3 $v, $x) |
|
| getIntermediateWithYValue (Vector3 $v, $y) |
|
| getIntermediateWithZValue (Vector3 $v, $z) |
|
| setComponents ($x, $y, $z) |
|
| fromObjectAdd (Vector3 $pos, $x, $y, $z) |
|
| __toString () |
|
◆ __construct()
Sign constructor.
- Parameters
-
Level | $level | |
CompoundTag | $nbt | |
41 if(!isset($nbt->Text1)){
44 if(!isset($nbt->Text2) or !($nbt->Text2 instanceof
StringTag)){
45 $nbt->Text2 =
new StringTag(
"Text2",
"");
47 if(!isset($nbt->Text3) or !($nbt->Text3 instanceof StringTag)){
48 $nbt->Text3 =
new StringTag(
"Text3",
"");
50 if(!isset($nbt->Text4) or !($nbt->Text4 instanceof StringTag)){
51 $nbt->Text4 =
new StringTag(
"Text4",
"");
54 parent::__construct(
$level, $nbt);
◆ getSpawnCompound()
- Returns
- CompoundTag
98 $this->namedtag->Text1,
99 $this->namedtag->Text2,
100 $this->namedtag->Text3,
101 $this->namedtag->Text4,
102 new IntTag(
"x", (
int) $this->x),
103 new IntTag(
"y", (
int) $this->y),
104 new IntTag(
"z", (
int) $this->z)
◆ getText()
- Returns
- array
85 $this->namedtag[
"Text1"],
86 $this->namedtag[
"Text2"],
87 $this->namedtag[
"Text3"],
88 $this->namedtag[
"Text4"]
◆ saveNBT()
59 unset($this->namedtag->Creator);
◆ setText()
setText |
( |
|
$line1 = "" , |
|
|
|
$line2 = "" , |
|
|
|
$line3 = "" , |
|
|
|
$line4 = "" |
|
) |
| |
- Parameters
-
string | $line1 | |
string | $line2 | |
string | $line3 | |
string | $line4 | |
- Returns
- bool
71 $this->namedtag->Text1 =
new StringTag(
"Text1", $line1);
72 $this->namedtag->Text2 =
new StringTag(
"Text2", $line2);
73 $this->namedtag->Text3 =
new StringTag(
"Text3", $line3);
74 $this->namedtag->Text4 =
new StringTag(
"Text4", $line4);
◆ updateCompoundTag()
- Parameters
-
- Returns
- bool
119 $ev =
new SignChangeEvent($this->
getBlock(), $player, [
126 if(!isset($this->namedtag->Creator) or $this->namedtag[
"Creator"] !== $player->getRawUniqueId()){
130 $this->level->getServer()->getPluginManager()->callEvent($ev);
132 if(!$ev->isCancelled()){
133 $this->
setText(...$ev->getLines());
The documentation for this class was generated from the following file:
- src/pocketmine/tile/Sign.php