mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
Throw exception when an invalid chunk is set as the parent of a Tile/Entity
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user