mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Chunks no longer exist in un-generated state
a non-generated chunk is now always represented by NULL. This forces the case of ungenerated chunks to be handled by all code, which is necessary because ungenerated chunks cannot be interacted with or modified in any meaningful way.
This commit is contained in:
@ -51,8 +51,6 @@ class Chunk{
|
||||
/** @var bool|null */
|
||||
protected $lightPopulated = false;
|
||||
/** @var bool */
|
||||
protected $terrainGenerated = false;
|
||||
/** @var bool */
|
||||
protected $terrainPopulated = false;
|
||||
|
||||
/**
|
||||
@ -207,15 +205,6 @@ class Chunk{
|
||||
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
}
|
||||
|
||||
public function isGenerated() : bool{
|
||||
return $this->terrainGenerated;
|
||||
}
|
||||
|
||||
public function setGenerated(bool $value = true) : void{
|
||||
$this->terrainGenerated = $value;
|
||||
$this->dirtyFlags |= self::DIRTY_FLAG_TERRAIN;
|
||||
}
|
||||
|
||||
public function addEntity(Entity $entity) : void{
|
||||
if($entity->isClosed()){
|
||||
throw new \InvalidArgumentException("Attempted to add a garbage closed Entity to a chunk");
|
||||
|
Reference in New Issue
Block a user