1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-10 00:28:22 +02:00

Expose other plugins ban masks.

This commit is contained in:
KHobbits
2013-09-04 07:19:30 +01:00
parent b8a2bce805
commit f342c10fda

View File

@@ -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)
{