From d7db3f6d681712ff3428bd4ad84f1100a3a0d52d Mon Sep 17 00:00:00 2001 From: Ka0rX Date: Sun, 2 Apr 2023 23:23:11 +0100 Subject: [PATCH] Fixed bug related to fetching player health when he is offline. --- .../main/java/net/Indyuce/mmocore/api/player/PlayerData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index abb701a0..0479bd9a 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -950,7 +950,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc @Override public double getHealth() { - return getPlayer() == null ? health : getPlayer().getHealth(); + return isOnline() ? getPlayer().getHealth():health ; } @Override