Disallow further modification of Signs by its creator after load/unload

This commit is contained in:
Shoghi Cervantes 2014-10-28 11:05:32 +01:00
parent 350cee3d41
commit b9f1812f61
2 changed files with 9 additions and 4 deletions

View File

@ -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 * @param Vector3 $pos
* *
* @return bool|Tile * @return Tile
*/ */
public function getTile(Vector3 $pos){ public function getTile(Vector3 $pos){
if($pos instanceof Position and $pos->getLevel() !== $this){ if($pos instanceof Position and $pos->getLevel() !== $this){
return false; return null;
} }
$tiles = $this->getChunkTiles($pos->x >> 4, $pos->z >> 4); $tiles = $this->getChunkTiles($pos->x >> 4, $pos->z >> 4);
if(count($tiles) > 0){ if(count($tiles) > 0){
@ -1382,7 +1382,7 @@ class Level implements ChunkManager, Metadatable{
} }
} }
return false; return null;
} }
/** /**

View File

@ -46,6 +46,11 @@ class Sign extends Spawnable{
parent::__construct($chunk, $nbt); parent::__construct($chunk, $nbt);
} }
public function saveNBT(){
parent::saveNBT();
unset($this->namedtag->Creator);
}
public function setText($line1 = "", $line2 = "", $line3 = "", $line4 = ""){ public function setText($line1 = "", $line2 = "", $line3 = "", $line4 = ""){
$this->namedtag->Text1 = new String("Text1", $line1); $this->namedtag->Text1 = new String("Text1", $line1);
$this->namedtag->Text2 = new String("Text2", $line2); $this->namedtag->Text2 = new String("Text2", $line2);