From 5abf62aa68a48ed2cf247d82f40f0c6a92154e6d Mon Sep 17 00:00:00 2001 From: Paldiu Date: Sun, 4 Apr 2021 22:42:59 -0500 Subject: [PATCH] Update BanManager.java --- .../github/simplexdev/simplexcore/ban/BanManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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(); }