Tweak logic for determining if a player is dead, fix issues with <1HP players being detected dead

feat/data-edit-commands
William 2 years ago
parent dd39482ed1
commit bac760165e

@ -618,7 +618,7 @@ public class BukkitPlayer extends OnlineUser {
@Override
public boolean isDead() {
return player.isDead() || player.getHealth() <= 0;
return player.getHealth() <= 0;
}
@Override

@ -321,6 +321,7 @@ public abstract class OnlineUser extends User {
if (!isOffline()) {
if (settings.getSynchronizationFeature(Settings.SynchronizationFeature.INVENTORIES)) {
if (isDead() && settings.saveDeadPlayerInventories) {
logger.debug("Player " + username + " is dead, so their inventory will be set to empty.");
add(CompletableFuture.runAsync(() -> builder.setInventory(ItemData.empty())));
} else {
add(getInventory().thenAccept(builder::setInventory));

Loading…
Cancel
Save