mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Properly fix concurrent modification when removing all attachments.
This commit is contained in:
parent
ec4f5cc34d
commit
f02691863b
1 changed files with 11 additions and 2 deletions
|
@ -357,7 +357,7 @@ public class BukkitPermissions {
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
/*
|
/*
|
||||||
* Failed to remove attachment
|
* Failed to remove attachment
|
||||||
* This usually means Bukkit no longer know of it.
|
* This usually means Bukkit no longer knows of it.
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
attachments.remove(player);
|
attachments.remove(player);
|
||||||
|
@ -372,9 +372,18 @@ public class BukkitPermissions {
|
||||||
Iterator<Player> itr = attachments.keySet().iterator();
|
Iterator<Player> itr = attachments.keySet().iterator();
|
||||||
|
|
||||||
while (itr.hasNext()){
|
while (itr.hasNext()){
|
||||||
removeAttachment(itr.next());
|
Player player = itr.next();
|
||||||
|
try {
|
||||||
|
player.removeAttachment(attachments.get(player));
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
/*
|
||||||
|
* Failed to remove attachment
|
||||||
|
* This usually means Bukkit no longer knows of it.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
attachments.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Player events tracked to cause Superperms updates
|
* Player events tracked to cause Superperms updates
|
||||||
|
|
Loading…
Reference in a new issue