Created
February 25, 2014 00:20
-
-
Save AustinLMayes/9200126 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@EventHandler(priority = EventPriority.NORMAL) | |
public void onLogin(PlayerLoginEvent e) { | |
Player player = e.getPlayer(); | |
List<Infraction> permanantBans = getInfractions(query, InfractionPacket.PunishmentType.PERMANANT_BAN); | |
if(!permanantBans.isEmpty()){ | |
Infraction last = permanantBans.get(permanantBans.size() - 1); | |
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, ChatColor.DARK_RED + "Permanently Banned! " + ChatColor.GOLD + "» " + ChatColor.AQUA + last.getReason()); | |
} | |
List<Infraction> tempBans = getInfractions(query, InfractionPacket.PunishmentType.BAN); | |
if(!tempBans.isEmpty()){ | |
for (Infraction stringBan : tempBans) { | |
Infraction inf = stringBan; | |
if (!inf.getExpires().before(new Date())) | |
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, ChatColor.DARK_RED + "Temporary Banned! " + ChatColor.GOLD + "» " + ChatColor.AQUA + inf.getReason() + "\n" + ChatColor.YELLOW + "Expires: " + ChatColor.AQUA + inf.getExpires()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment