summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)
{