mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
get entity names or sizes by eids or instances
This commit is contained in:
parent
53928f4e88
commit
69d4e52d44
12 changed files with 35 additions and 12 deletions
|
|
@ -19,6 +19,7 @@ class PropertyEntity{
|
|||
return $this->name;
|
||||
}
|
||||
}
|
||||
|
||||
class EntityList{
|
||||
public function getEntities(){
|
||||
return $this->entities;
|
||||
|
|
@ -26,12 +27,12 @@ class EntityList{
|
|||
public function addEntity(PropertyEntity $property){
|
||||
$this->entities[$property->getEntityType()] = $property;
|
||||
}
|
||||
|
||||
public function getEntityFromTypeAndClass($type, $class){
|
||||
return isset($this->entities[$type]) && $this->entities[$type]->getEntityClass() === $class ? $this->entities[$type] : 0;
|
||||
}
|
||||
private $entities = [];
|
||||
}
|
||||
|
||||
class EntityRegistry{
|
||||
public static $entityList;
|
||||
/*Register all entities*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue