forked from Upstream/mmocore
Fixed the bug where player die when joining server.
This commit is contained in:
parent
395844c25a
commit
c31a3fcec1
@ -122,6 +122,7 @@ public class YAMLPlayerDataManager extends PlayerDataManager {
|
||||
data.setStamina(config.contains("stamina") ? config.getDouble("stamina") : data.getStats().getStat("MAX_STAMINA"));
|
||||
data.setStellium(config.contains("stellium") ? config.getDouble("stellium") : data.getStats().getStat("MAX_STELLIUM"));
|
||||
double health = config.contains("health") ? config.getDouble("health") : data.getStats().getStat("MAX_HEALTH");
|
||||
health = health == 0 ? 20 : health;
|
||||
health = Math.min(health, data.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
|
||||
data.getPlayer().setHealth(health);
|
||||
data.setFullyLoaded();
|
||||
|
Loading…
Reference in New Issue
Block a user