Throw exception when an invalid chunk is set as the parent of a Tile/Entity

This commit is contained in:
Shoghi Cervantes
2014-07-28 21:40:50 +02:00
parent e97139919a
commit 7d8a961374
2 changed files with 9 additions and 0 deletions

View File

@@ -147,6 +147,10 @@ abstract class Entity extends Position implements Metadatable{
public function __construct(Chunk $chunk, Compound $nbt){
if($chunk->getLevel() === null){
throw new \Exception("Invalid garbage Chunk given to Entity");
}
$this->id = Entity::$entityCount++;
$this->justCreated = true;
$this->namedtag = $nbt;