From 0f89de6c2a21619684dd0c6d49dd1a7a2141076b Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 5 Jan 2023 21:16:50 -0800 Subject: [PATCH] Make list mutable. --- .../world/bentobox/bentobox/panels/settings/SettingsTab.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java index 28b63ebe4..9657aba49 100644 --- a/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java +++ b/src/main/java/world/bentobox/bentobox/panels/settings/SettingsTab.java @@ -4,6 +4,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -77,7 +78,7 @@ public class SettingsTab implements Tab, ClickHandler { List flags = plugin.getFlagsManager().getFlags().stream().filter(f -> f.getType().equals(type)) // We're stripping colors to avoid weird sorting issues .sorted(Comparator.comparing(flag -> ChatColor.stripColor(user.getTranslation(flag.getNameReference())))) - .toList(); + .collect(Collectors.toList()); // Remove any that are not for this game mode plugin.getIWM().getAddon(world).ifPresent(gm -> flags.removeIf(f -> !f.getGameModes().isEmpty() && !f.getGameModes().contains(gm))); // Remove any that are the wrong rank or that will be on the top row