mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-27 05:13:46 +00:00
Fix a couple of Sign bugs
This commit is contained in:
parent
1e539c4e3b
commit
3025f76cd0
@ -40,7 +40,7 @@ class Sign extends Spawnable{
|
|||||||
$this->text = explode("\n", $nbt->Text->getValue());
|
$this->text = explode("\n", $nbt->Text->getValue());
|
||||||
unset($nbt->Text);
|
unset($nbt->Text);
|
||||||
}else{
|
}else{
|
||||||
for($i = 1; $i < 4; ++$i){
|
for($i = 1; $i <= 4; ++$i){
|
||||||
$textKey = "Text$i";
|
$textKey = "Text$i";
|
||||||
if(isset($nbt->$textKey)){
|
if(isset($nbt->$textKey)){
|
||||||
$this->text[$i - 1] = $nbt->$textKey->getValue();
|
$this->text[$i - 1] = $nbt->$textKey->getValue();
|
||||||
@ -56,9 +56,9 @@ class Sign extends Spawnable{
|
|||||||
parent::saveNBT();
|
parent::saveNBT();
|
||||||
$this->namedtag->Text = new StringTag("Text", implode("\n", $this->text));
|
$this->namedtag->Text = new StringTag("Text", implode("\n", $this->text));
|
||||||
|
|
||||||
foreach($this->text as $i => $line){ //Backwards-compatibility
|
for($i = 1; $i <= 4; ++$i){ //Backwards-compatibility
|
||||||
$textKey = "Text$i";
|
$textKey = "Text$i";
|
||||||
$this->namedtag->$textKey = new StringTag($textKey, $this->getLine($i));
|
$this->namedtag->$textKey = new StringTag($textKey, $this->getLine($i - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($this->namedtag->Creator);
|
unset($this->namedtag->Creator);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user