Revert "Workaround for some plugins crashing clients during PlayerLoginEvent"

This reverts commit 087a994393be23f694c6d0585bcd3797a15bf50b.
This commit is contained in:
Dylan K. Taylor 2017-09-23 13:23:19 +01:00
parent 0523f26613
commit 826ec90856

View File

@ -1868,6 +1868,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
protected function completeLoginSequence(){
parent::__construct($this->level, $this->namedtag);
$this->server->getPluginManager()->callEvent($ev = new PlayerLoginEvent($this, "Plugin reason"));
if($ev->isCancelled()){
$this->close($this->getLeaveMessage(), $ev->getKickMessage());
return;
}
if(!$this->hasValidSpawnPosition()){
if(isset($this->namedtag->SpawnLevel) and ($level = $this->server->getLevelByName((string) $this->namedtag["SpawnLevel"])) instanceof Level){
@ -1905,13 +1911,6 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$pk->worldName = $this->server->getMotd();
$this->dataPacket($pk);
$this->server->getPluginManager()->callEvent($ev = new PlayerLoginEvent($this, "Plugin reason"));
if($ev->isCancelled()){
$this->close($this->getLeaveMessage(), $ev->getKickMessage());
return;
}
$this->level->sendTime($this);
$this->sendAttributes(true);