mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
simple entity registering, tested on pig, some classes were created, althrough they are still not implemented
This commit is contained in:
parent
e5abc85f94
commit
6a321aabe0
13 changed files with 116 additions and 4 deletions
|
|
@ -270,7 +270,14 @@ class EntityAPI{
|
|||
|
||||
public function add(Level $level, $class, $type = 0, $data = array()){
|
||||
$eid = $this->eCnt++;
|
||||
$this->entities[$eid] = new Entity($level, $eid, $class, $type, $data);
|
||||
$efl = EntityRegistry::$entityList->getEntityFromType($type);
|
||||
if($efl instanceof PropertyEntity){
|
||||
$class = $efl->getEntityName();
|
||||
console("yey");
|
||||
$this->entities[$eid] = new $class($level, $eid, $efl->getEntityClass(), $efl->getEntityType(), $data);
|
||||
}else{
|
||||
$this->entities[$eid] = new Entity($level, $eid, $class, $type, $data);
|
||||
}
|
||||
$this->server->handle("entity.add", $this->entities[$eid]);
|
||||
return $this->entities[$eid];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue