Moved Entity::get() to Level::getEntity() and removed Entity::getAll()

This commit is contained in:
Shoghi Cervantes 2014-05-24 13:30:37 +02:00
parent ef6ca9d2cd
commit abff932d8f
2 changed files with 10 additions and 9 deletions

View File

@ -118,14 +118,6 @@ abstract class Entity extends Position implements Metadatable{
public $closed;
public static function get($entityID){
return isset(Entity::$list[$entityID]) ? Entity::$list[$entityID] : false;
}
public static function getAll(){
return Entity::$list;
}
public function __construct(Level $level, Compound $nbt){
$this->id = Entity::$entityCount++;

View File

@ -67,7 +67,7 @@ class Level{
public $players = [];
/** @var Entity[] */
public $entities = [];
protected $entities = [];
/** @var Entity[][] */
public $chunkEntities = [];
@ -798,6 +798,15 @@ class Level{
return $this->level->getBiome((int) $x, (int) $z, $biome);
}
/**
* @param int $entityId
*
* @return Entity
*/
public function getEntity($entityId){
return isset($this->entities[$entityId]) ? $this->entities[$entityId] : null;
}
/**
* Gets the list of all the entitites in this level
*