mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-01 15:53:04 +00:00
Sign: simplify network data reading, ensure text is always 4 lines, closes #2610
This commit is contained in:
parent
93dd05a03e
commit
a71af952ba
@ -130,14 +130,9 @@ class Sign extends Spawnable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($nbt->hasTag(self::TAG_TEXT_BLOB, StringTag::class)){
|
if($nbt->hasTag(self::TAG_TEXT_BLOB, StringTag::class)){
|
||||||
$lines = array_pad(explode("\n", $nbt->getString(self::TAG_TEXT_BLOB)), 4, "");
|
$lines = array_slice(array_pad(explode("\n", $nbt->getString(self::TAG_TEXT_BLOB)), 4, ""), 0, 4);
|
||||||
}else{
|
}else{
|
||||||
$lines = [
|
return false;
|
||||||
$nbt->getString(sprintf(self::TAG_TEXT_LINE, 1)),
|
|
||||||
$nbt->getString(sprintf(self::TAG_TEXT_LINE, 2)),
|
|
||||||
$nbt->getString(sprintf(self::TAG_TEXT_LINE, 3)),
|
|
||||||
$nbt->getString(sprintf(self::TAG_TEXT_LINE, 4))
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$removeFormat = $player->getRemoveFormat();
|
$removeFormat = $player->getRemoveFormat();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user