From b22a2ef914bb9e12cfb5739ff265f73d95d4932d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 5 Jan 2019 12:46:11 +0000 Subject: [PATCH 1/2] Living: Despawn in endDeathAnimation() this removes the necessity for the player to do this. --- src/pocketmine/Player.php | 5 +---- src/pocketmine/entity/Living.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index e3222ec6c..365565579 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -3625,10 +3625,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ } protected function onDeathUpdate(int $tickDiff) : bool{ - if(parent::onDeathUpdate($tickDiff)){ - $this->despawnFromAll(); //non-player entities rely on close() to do this for them - } - + parent::onDeathUpdate($tickDiff); return false; //never flag players for despawn } diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index d9987c5f7..829df4a58 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -665,7 +665,7 @@ abstract class Living extends Entity implements Damageable{ } protected function endDeathAnimation() : void{ - //TODO + $this->despawnFromAll(); } public function entityBaseTick(int $tickDiff = 1) : bool{ From a99e15012caecf565759bc13b9a761e0c4952ff8 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 5 Jan 2019 17:39:20 +0000 Subject: [PATCH 2/2] Backport no-ai hack to disable pre-spawn movement --- src/pocketmine/Player.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 365565579..f0c0ea737 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1076,6 +1076,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->server->broadcastMessage($ev->getJoinMessage()); } + $this->setImmobile(false); $this->noDamageTicks = 60; foreach($this->usedChunks as $index => $c){ @@ -2143,6 +2144,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $this->setNameTagVisible(); $this->setNameTagAlwaysVisible(); $this->setCanClimb(); + $this->setImmobile(); //disable pre-spawn movement $this->server->getLogger()->info($this->getServer()->getLanguage()->translateString("pocketmine.player.logIn", [ TextFormat::AQUA . $this->username . TextFormat::WHITE,