mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Disallow further modification of Signs by its creator after load/unload
This commit is contained in:
parent
350cee3d41
commit
b9f1812f61
@ -1363,15 +1363,15 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Tile in a position, or false if not found
|
||||
* Returns the Tile in a position, or null if not found
|
||||
*
|
||||
* @param Vector3 $pos
|
||||
*
|
||||
* @return bool|Tile
|
||||
* @return Tile
|
||||
*/
|
||||
public function getTile(Vector3 $pos){
|
||||
if($pos instanceof Position and $pos->getLevel() !== $this){
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
$tiles = $this->getChunkTiles($pos->x >> 4, $pos->z >> 4);
|
||||
if(count($tiles) > 0){
|
||||
@ -1382,7 +1382,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -46,6 +46,11 @@ class Sign extends Spawnable{
|
||||
parent::__construct($chunk, $nbt);
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
unset($this->namedtag->Creator);
|
||||
}
|
||||
|
||||
public function setText($line1 = "", $line2 = "", $line3 = "", $line4 = ""){
|
||||
$this->namedtag->Text1 = new String("Text1", $line1);
|
||||
$this->namedtag->Text2 = new String("Text2", $line2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user