mirror of
https://github.com/TotalFreedomMC/TF-LibsDisguises.git
synced 2025-02-11 11:40:29 +00:00
Fix a concurrent modification error when calling disguiseToAll wrongly
This commit is contained in:
parent
0e125523f4
commit
61e021e463
1 changed files with 2 additions and 1 deletions
|
@ -3,6 +3,7 @@ package me.libraryaddict.disguise;
|
|||
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
|
||||
import com.comphenix.protocol.wrappers.WrappedGameProfile;
|
||||
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
|
||||
import java.util.ArrayList;
|
||||
import me.libraryaddict.disguise.disguisetypes.*;
|
||||
import me.libraryaddict.disguise.disguisetypes.TargetedDisguise.TargetType;
|
||||
import me.libraryaddict.disguise.disguisetypes.watchers.LivingWatcher;
|
||||
|
@ -282,7 +283,7 @@ public class DisguiseAPI {
|
|||
// You called the disguiseToAll method foolish mortal! Prepare to have your custom settings wiped!!!
|
||||
((TargetedDisguise) disguise).setDisguiseTarget(TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS);
|
||||
|
||||
for (String observer : ((TargetedDisguise) disguise).getObservers()) {
|
||||
for (String observer : new ArrayList<>(((TargetedDisguise) disguise).getObservers())) {
|
||||
((TargetedDisguise) disguise).removePlayer(observer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue