diff --git a/changelog.md b/changelog.md index 8df5175..a40687a 100644 --- a/changelog.md +++ b/changelog.md @@ -24,6 +24,7 @@ These changes will (most likely) be included in the next version. ### Fixed - MobArena no longer throws errors when handling block explosions on Minecraft 1.21. +- MobArena no longer throws errors during the automatic removal of spectators when using `auto-leave-on-end: true`. - The `shuffle-positions` ability now correctly shuffles the position of the boss as well if `monster-teleport` is set to `false`. - The `obsidian-bomb` ability no longer breaks boss waves. - Text on Arena Signs is no longer explicitly truncated. This fixes an issue where color codes would count towards the character limit, causing the text that would otherwise fit on the sign to be cut off. diff --git a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java index ed8eeb1..abaaa23 100644 --- a/src/main/java/com/garbagemule/MobArena/ArenaImpl.java +++ b/src/main/java/com/garbagemule/MobArena/ArenaImpl.java @@ -665,7 +665,8 @@ public class ArenaImpl implements Arena // Auto-leave if (settings.getBoolean("auto-leave-on-end", false)) { - specPlayers.forEach(this::playerLeave); + List spectators = new ArrayList<>(specPlayers); + spectators.forEach(this::playerLeave); } return true;