mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-18 11:45:07 +08:00
Fix rare ConcurrentModificationException in quit handler
Copies the list of viewers before iterating over it to fix a rare CME that is *sometimes* thrown. It's not clear *why* this broke - Spigot seems to have changed behaviour in late 1.15 or 1.16?
This commit is contained in:
parent
11cd57e8fb
commit
ab545dc44c
@ -212,7 +212,8 @@ public class EssentialsPlayerListener implements Listener {
|
||||
user.getBase().getOpenInventory().getTopInventory().clear();
|
||||
}
|
||||
|
||||
for (HumanEntity viewer : user.getBase().getInventory().getViewers()) {
|
||||
ArrayList<HumanEntity> viewers = new ArrayList<>(user.getBase().getInventory().getViewers());
|
||||
for (HumanEntity viewer : viewers) {
|
||||
if (viewer instanceof Player) {
|
||||
User uviewer = ess.getUser((Player) viewer);
|
||||
if (uviewer.isInvSee()) {
|
||||
|
Loading…
Reference in New Issue
Block a user