Player: patch exploits relating to quitting on death (#2017)

* Revert "Revert bad duct-tape fix that broke lots of other things"
This reverts commit 4a4900e5e7.

Player: Perform respawn actions when joining while dead
This fixes exploits related to #1567 by calling respawn logic on join when the player has zero health.
This is a shitty fix and doesn't solve the actual issues described in #1567, but it's a simple solution for the exploits related to it.
This commit is contained in:
Dylan K. Taylor
2018-02-13 21:23:31 +00:00
committed by GitHub
parent 9abfd54cc1
commit f66928c345
2 changed files with 51 additions and 45 deletions

View File

@ -929,6 +929,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
if($amount <= 0){
if($this->isAlive()){
$this->health = 0;
$this->kill();
}
}elseif($amount <= $this->getMaxHealth() or $amount < $this->health){