diff --git a/Essentials/src/com/earth2me/essentials/EssentialsServerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsServerListener.java index a5b0d04c7..8f8c3a4dc 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsServerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsServerListener.java @@ -12,6 +12,7 @@ import java.util.Iterator; public class EssentialsServerListener implements Listener { private final transient IEssentials ess; + private boolean errorLogged = false; public EssentialsServerListener(final IEssentials ess) { this.ess = ess; @@ -19,11 +20,19 @@ public class EssentialsServerListener implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onServerListPing(final ServerListPingEvent event) { - Iterator iterator = event.iterator(); - while (iterator.hasNext()) { - Player player = iterator.next(); - if (ess.getUser(player).isVanished()) { - iterator.remove(); + try { + Iterator iterator = event.iterator(); + while (iterator.hasNext()) { + Player player = iterator.next(); + if (ess.getUser(player).isVanished()) { + iterator.remove(); + } + } + } catch (UnsupportedOperationException e) { + if (!errorLogged) { + ess.getLogger().warning("Current server implementation does not support " + + "hiding players from server list ping. Update or contact the maintainers."); + errorLogged = true; } } }