Skip to content

Commit

Permalink
Fixed an issue where rebanning a player would not properly overwrite …
Browse files Browse the repository at this point in the history
…the previous ban
  • Loading branch information
DarkArc committed Jul 5, 2014
1 parent 546910b commit c0e6f41
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/com/sk89q/commandbook/bans/CSVBanDatabase.java
Expand Up @@ -263,9 +263,17 @@ public void ban(UUID ID, String name, String address, CommandSender source, Stri
Validate.isTrue(ID != null || address != null, "You must specify either an ID, or address");
Ban ban = new Ban(ID, name, address, reason, System.currentTimeMillis(), end);
if (ID != null) {
Ban oldBan = UUIDBan.remove(ID);
if (oldBan != null) {
bans.remove(oldBan);
}
UUIDBan.put(ID, ban);
}
if (address != null) {
Ban oldBan = ipBan.remove(address);
if (oldBan != null) {
bans.remove(oldBan);
}
ipBan.put(address, ban);
}
bans.add(ban);
Expand Down

0 comments on commit c0e6f41

Please sign in to comment.