Report Spigot health error to admins.

Using the new `mobarena.admin.errors` permission, this commit provides
server owners with a way to make the infamous Spigot health error much
more visible by sending the error message to any "admins" online when
the error occurs.

Closes #764
This commit is contained in:
Andreas Troelsen 2023-11-03 22:50:12 +01:00
parent 7ef7707886
commit 6a428166e5
1 changed files with 5 additions and 0 deletions

View File

@ -244,6 +244,11 @@ public class MASpawnThread implements Runnable
} else {
e.setCustomName("SPIGOT ERROR");
}
for (Player p : plugin.getServer().getOnlinePlayers()) {
if (p.hasPermission("mobarena.admin.errors")) {
arena.getMessenger().tell(p, "Failed to set boss health (" + health + ") in arena " + arena.configName() + " (wave " + wave + ") because Spigot 'maxHealth' is too low. See console for details.");
}
}
}
// Switch on the type.