diff --git a/src/main/java/io/github/simplexdev/simplexcore/ban/BanManager.java b/src/main/java/io/github/simplexdev/simplexcore/ban/BanManager.java index 7e65d99..e936d6b 100644 --- a/src/main/java/io/github/simplexdev/simplexcore/ban/BanManager.java +++ b/src/main/java/io/github/simplexdev/simplexcore/ban/BanManager.java @@ -36,11 +36,12 @@ public class BanManager extends SimplexListener { } AtomicReference temp = new AtomicReference<>(); - banMap.forEach((ban, type) -> { - if (ban.getOffender().equals(player.getUniqueId())) { - temp.set(ban); - } - }); + + banMap.keySet() + .stream() + .filter(ban -> ban.getOffender().equals(player.getUniqueId())) + .forEach(temp::set); + return temp.get(); }