From 460cec0fb8ae80bdb212d7630c19738af8fa06ac Mon Sep 17 00:00:00 2001 From: garbagemule Date: Fri, 11 Jul 2014 00:17:30 -0400 Subject: [PATCH] Add max health guard for players. --- resources/plugin.yml | 2 +- src/com/garbagemule/MobArena/ArenaImpl.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/plugin.yml b/resources/plugin.yml index eaf4488..f50026a 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -1,7 +1,7 @@ name: MobArena author: garbagemule main: com.garbagemule.MobArena.MobArena -version: 0.96.6.2 +version: 0.96.6.3 softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault] commands: ma: diff --git a/src/com/garbagemule/MobArena/ArenaImpl.java b/src/com/garbagemule/MobArena/ArenaImpl.java index b898568..3f9b704 100644 --- a/src/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/com/garbagemule/MobArena/ArenaImpl.java @@ -1041,7 +1041,8 @@ public class ArenaImpl implements Arena PlayerData mp = playerData.remove(p); // Health must be handled in a certain way because of Heroes - setHealth(p, mp.health()); + // Math.min to guard for ItemLoreStats weirdness + setHealth(p, Math.min(p.getMaxHealth(), mp.health())); // Put out fire. Delays.douse(plugin, p, 3);