aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2022-08-04 16:37:26 -0400
committerbowser0000 <bowser0000@gmail.com>2022-08-04 16:37:26 -0400
commitb3eb1191c49eee416b71859ee8303293e9aed72b (patch)
tree722e0dd467f0a11341753e78a288409068d8bff9 /src/main/java/me
parent8f01ffda41f532dbdfbe70a21c6c02f4fc713c1e (diff)
downloadSkyblockMod-b3eb1191c49eee416b71859ee8303293e9aed72b.tar.gz
SkyblockMod-b3eb1191c49eee416b71859ee8303293e9aed72b.tar.bz2
SkyblockMod-b3eb1191c49eee416b71859ee8303293e9aed72b.zip
Fix exception in scoreboard
Diffstat (limited to 'src/main/java/me')
-rw-r--r--src/main/java/me/Danker/handlers/ScoreboardHandler.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/me/Danker/handlers/ScoreboardHandler.java b/src/main/java/me/Danker/handlers/ScoreboardHandler.java
index c8bc7c7..b5785e3 100644
--- a/src/main/java/me/Danker/handlers/ScoreboardHandler.java
+++ b/src/main/java/me/Danker/handlers/ScoreboardHandler.java
@@ -11,6 +11,7 @@ import net.minecraft.util.StringUtils;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.stream.Collectors;
@@ -38,7 +39,14 @@ public class ScoreboardHandler {
ScoreObjective objective = scoreboard.getObjectiveInDisplaySlot(1);
if (objective == null) return lines;
- Collection<Score> scores = scoreboard.getSortedScores(objective);
+ Collection<Score> scores;
+ try {
+ scores = scoreboard.getSortedScores(objective);
+ } catch (ConcurrentModificationException ex) {
+ ex.printStackTrace();
+ return new ArrayList<>();
+ }
+
List<Score> list = scores.stream()
.filter(input -> input != null && input.getPlayerName() != null && !input.getPlayerName()
.startsWith("#"))