mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Expose other plugins ban masks.
This commit is contained in:
parent
c056ba0059
commit
0926da3782
1 changed files with 16 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue