Add max health guard for players.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
name: MobArena
|
name: MobArena
|
||||||
author: garbagemule
|
author: garbagemule
|
||||||
main: com.garbagemule.MobArena.MobArena
|
main: com.garbagemule.MobArena.MobArena
|
||||||
version: 0.96.6.2
|
version: 0.96.6.3
|
||||||
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
softdepend: [Multiverse-Core,Towny,Heroes,MagicSpells,Vault]
|
||||||
commands:
|
commands:
|
||||||
ma:
|
ma:
|
||||||
|
|||||||
@@ -1041,7 +1041,8 @@ public class ArenaImpl implements Arena
|
|||||||
PlayerData mp = playerData.remove(p);
|
PlayerData mp = playerData.remove(p);
|
||||||
|
|
||||||
// Health must be handled in a certain way because of Heroes
|
// 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.
|
// Put out fire.
|
||||||
Delays.douse(plugin, p, 3);
|
Delays.douse(plugin, p, 3);
|
||||||
|
|||||||
Reference in New Issue
Block a user