Use GENERIC_MAX_HEALTH attribute when setting mount health.

getMaxHealth() is deprecated.

Partial fix for #406
This commit is contained in:
Andreas Troelsen
2019-07-21 23:36:39 +02:00
parent 6c6e979b9e
commit e62b361766
@@ -960,7 +960,7 @@ public class ArenaImpl implements Arena
mount.setTamed(true); mount.setTamed(true);
mount.setOwner(p); mount.setOwner(p);
mount.addPassenger(p); mount.addPassenger(p);
mount.setHealth(mount.getMaxHealth()); mount.setHealth(mount.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());
// Add saddle // Add saddle
mount.getInventory().addItem(new ItemStack(Material.SADDLE)); mount.getInventory().addItem(new ItemStack(Material.SADDLE));