Fix resetting health in 1.8.8. Resolves #468

This commit is contained in:
Daniel Saukel 2018-10-04 23:02:13 +02:00
parent ddb955a8c1
commit ad22027b7e

View File

@ -350,8 +350,10 @@ public class DGlobalPlayer implements PlayerWrapper {
player.setExp(data.getOldExp()); player.setExp(data.getOldExp());
if (is1_9) { if (is1_9) {
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(data.getOldMaxHealth()); player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(data.getOldMaxHealth());
}
player.setHealth(data.getOldHealth() <= data.getOldMaxHealth() ? data.getOldHealth() : data.getOldMaxHealth()); player.setHealth(data.getOldHealth() <= data.getOldMaxHealth() ? data.getOldHealth() : data.getOldMaxHealth());
} else {
player.setHealth(player.getMaxHealth());
}
player.setFoodLevel(data.getOldFoodLevel()); player.setFoodLevel(data.getOldFoodLevel());
player.setGameMode(data.getOldGameMode()); player.setGameMode(data.getOldGameMode());
player.setFireTicks(data.getOldFireTicks()); player.setFireTicks(data.getOldFireTicks());