Add a guard for ridiculous Spigot health issue.

This commit is contained in:
garbagemule 2014-12-08 19:37:11 +01:00
parent 246c05e7a9
commit a8755ea496

View File

@ -170,7 +170,14 @@ public class MASpawnThread implements Runnable
// Set the health. // Set the health.
e.resetMaxHealth(); // Avoid conflicts/enormous multiplications from other plugins handling Mob health e.resetMaxHealth(); // Avoid conflicts/enormous multiplications from other plugins handling Mob health
int health = (int) Math.max(1D, e.getMaxHealth() * mul); int health = (int) Math.max(1D, e.getMaxHealth() * mul);
e.setMaxHealth(health); try {
e.setMaxHealth(health);
} catch (IllegalArgumentException ex) {
// Spigot... *facepalm*
Messenger.severe("Can't set health to " + health + ", using 2000. If you are running Spigot, set 'maxHealth' higher.");
ex.printStackTrace();
health = 2000;
}
e.setHealth(health); e.setHealth(health);
// Switch on the type. // Switch on the type.