Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'tempban' of github.com:shiinee/Combat-Tag into tempban

Conflicts:
	CombatTag/com/trc202/CombatTagListeners/NoPvpPlayerListener.java
  • Loading branch information...
commit 2f68cac37294997e3402397dae808b7a06b5d763 2 parents 4fa95fc + 50da32e
@shiinee authored
View
7 CombatTag/com/trc202/CombatTagListeners/NoPvpPlayerListener.java
@@ -38,8 +38,7 @@ public void onPlayerJoin(PlayerJoinEvent event){
@EventHandler(ignoreCancelled = true)
public void onPlayerLogin(PlayerLoginEvent event){
- Player loginPlayer = event.getPlayer();
- tryUnbanIfTempBanned(loginPlayer);
+ tryUnbanIfTempBanned(event);
}
@EventHandler(ignoreCancelled = true)
@@ -114,15 +113,17 @@ public void tempBanIfPvP(Player player){
}
}
- public void tryUnbanIfTempBanned(Player player){
+ public void tryUnbanIfTempBanned(PlayerLoginEvent event){
// When user attempts to join, check whether he has a temp ban registered.
// If the temp ban has expired, unban the player so he can join.
+ Player player = event.getPlayer();
if (bannedPlayers.containsKey(player.getName())) {
long deadline = bannedPlayers.get(player.getName());
if (deadline < System.currentTimeMillis()) {
plugin.log.info("[CombatTag] Temporary combat-logging ban for " + player.getName() + " expired. Unbanning.");
player.setBanned(false);
bannedPlayers.remove(player.getName());
+ event.allow();
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.