Fix #2018. using player's health value instead of isDead (which is unreliable) (#2302)

This commit is contained in:
Pietro T 2021-03-31 20:47:34 +02:00 committed by GitHub
parent fc8c9d8748
commit 12cf3aa060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -273,7 +273,7 @@ public class SpawnLoader implements Reloadable {
* @return location of the given player if alive, spawn location if dead.
*/
public Location getPlayerLocationOrSpawn(Player player) {
if (player.isOnline() && player.isDead()) {
if (player.getHealth() <= 0.0) {
return getSpawnLocation(player);
}
return player.getLocation();