summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-09-04 07:19:30 +0100
committerKHobbits <rob@khobbits.co.uk>2013-09-04 07:19:30 +0100
commitf342c10fdada81c9aaec5e573d663bdf0589854a (patch)
tree39fcea0715bd69728f077f32a6923d3a3df146aa
parentb8a2bce8055aff738bad9b3b7ce19a0deb011976 (diff)
downloadEssentials-f342c10fdada81c9aaec5e573d663bdf0589854a.tar
Essentials-f342c10fdada81c9aaec5e573d663bdf0589854a.tar.gz
Essentials-f342c10fdada81c9aaec5e573d663bdf0589854a.tar.lz
Essentials-f342c10fdada81c9aaec5e573d663bdf0589854a.tar.xz
Essentials-f342c10fdada81c9aaec5e573d663bdf0589854a.zip
Expose other plugins ban masks.
-rw-r--r--Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
index e5839f104..150c83b68 100644
--- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
+++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java
@@ -299,6 +299,21 @@ public class EssentialsPlayerListener implements Listener
user.setCompassTarget(updateLoc);
}
}
+
+ @EventHandler(priority = EventPriority.LOWEST)
+ public void onPlayerLogin2(final PlayerLoginEvent event)
+ {
+ switch (event.getResult())
+ {
+ case KICK_BANNED:
+ break;
+ default:
+ return;
+ }
+
+ final String banReason = _("banFormat", _("defaultBanReason"), "Console");
+ event.disallow(Result.KICK_BANNED, banReason);
+ }
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerLogin(final PlayerLoginEvent event)
@@ -322,7 +337,7 @@ public class EssentialsPlayerListener implements Listener
String banReason = user.getBanReason();
if (banReason == null || banReason.isEmpty() || banReason.equalsIgnoreCase("ban"))
{
- banReason = _("defaultBanReason");
+ banReason = event.getKickMessage();
}
if (user.getBanTimeout() > 0)
{