mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Moved Entity::get() to Level::getEntity() and removed Entity::getAll()
This commit is contained in:
parent
ef6ca9d2cd
commit
abff932d8f
@ -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++;
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user