mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Sign: Pad exploded blob to appropriate size
I'm not sure how it's possible to get one of these blobs with less newlines than expected, but whatever I guess closes #2152
This commit is contained in:
parent
dd1dfefd83
commit
396056c636
@ -42,7 +42,7 @@ class Sign extends Spawnable{
|
||||
|
||||
public function __construct(Level $level, CompoundTag $nbt){
|
||||
if($nbt->hasTag(self::TAG_TEXT_BLOB, StringTag::class)){ //MCPE 1.2 save format
|
||||
$this->text = explode("\n", $nbt->getString(self::TAG_TEXT_BLOB));
|
||||
$this->text = array_pad(explode("\n", $nbt->getString(self::TAG_TEXT_BLOB)), 4, "");
|
||||
assert(count($this->text) === 4, "Too many lines!");
|
||||
$nbt->removeTag(self::TAG_TEXT_BLOB);
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user