Separate Level management functionality from Server, clean up a bunch of mess

This commit is contained in:
Dylan K. Taylor
2019-01-12 19:11:05 +00:00
parent 27761ac26e
commit 5052b75565
22 changed files with 530 additions and 509 deletions

View File

@ -625,7 +625,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
public function getOwningEntity() : ?Entity{
$eid = $this->getOwningEntityId();
if($eid !== null){
return $this->server->findEntity($eid);
return $this->server->getLevelManager()->findEntity($eid);
}
return null;
@ -665,7 +665,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
public function getTargetEntity() : ?Entity{
$eid = $this->getTargetEntityId();
if($eid !== null){
return $this->server->findEntity($eid);
return $this->server->getLevelManager()->findEntity($eid);
}
return null;

View File

@ -150,7 +150,7 @@ class ExperienceOrb extends Entity{
return null;
}
$entity = $this->server->findEntity($this->targetPlayerRuntimeId);
$entity = $this->server->getLevelManager()->findEntity($this->targetPlayerRuntimeId);
if($entity instanceof Human){
return $entity;
}