some improvements to the horrendous mess that is the handling of joining and quitting, fixed some crashes, probably caused some other crashes

I can't fix this completely because it's just too much of a fucking mess. NEED to separate network stuff from Player.
This commit is contained in:
Dylan K. Taylor
2017-03-30 19:33:47 +01:00
parent 45e5b6b04c
commit 69ac80518c
4 changed files with 64 additions and 57 deletions

View File

@ -1661,7 +1661,10 @@ abstract class Entity extends Location implements Metadatable{
if(!$this->closed){
$this->server->getPluginManager()->callEvent(new EntityDespawnEvent($this));
$this->closed = true;
$this->despawnFromAll();
$this->hasSpawned = [];
if($this->chunk !== null){
$this->chunk->removeEntity($this);
$this->chunk = null;