mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 09:39:56 +00:00
Revert "Workaround for some plugins crashing clients during PlayerLoginEvent"
This reverts commit 087a994393be23f694c6d0585bcd3797a15bf50b.
This commit is contained in:
parent
0523f26613
commit
826ec90856
@ -1868,6 +1868,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
protected function completeLoginSequence(){
|
protected function completeLoginSequence(){
|
||||||
parent::__construct($this->level, $this->namedtag);
|
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(!$this->hasValidSpawnPosition()){
|
||||||
if(isset($this->namedtag->SpawnLevel) and ($level = $this->server->getLevelByName((string) $this->namedtag["SpawnLevel"])) instanceof Level){
|
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();
|
$pk->worldName = $this->server->getMotd();
|
||||||
$this->dataPacket($pk);
|
$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->level->sendTime($this);
|
||||||
|
|
||||||
$this->sendAttributes(true);
|
$this->sendAttributes(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user