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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user