mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 09:39:05 +00:00
fixed concurrent exception thrown when removing animations from being ticked
This commit is contained in:
1 parent
59cd5b6fe6
commit
3f3700af4f
2 files changed
+12
-6
No files matched your search
@@ -23,11 +23,12 @@ import noppes.npcs.controllers.data.PlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.util.MillisTimer;
|
||||
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
public static HashSet<Animation> clientPlayingAnimations = new HashSet<>();
|
||||
public static HashSet<Animation> serverPlayingAnimations = new HashSet<>();
|
||||
public final static HashSet<Animation> clientPlayingAnimations = new HashSet<>();
|
||||
public final static HashSet<Animation> serverPlayingAnimations = new HashSet<>();
|
||||
protected MillisTimer animationTimer = new MillisTimer(1000);
|
||||
protected long totalTicks;
|
||||
|
||||
@@ -55,8 +56,11 @@ public class CommonProxy implements IGuiHandler {
|
||||
totalTicks++;
|
||||
}
|
||||
totalTicks %= 60 * 60 * 1000;
|
||||
clientPlayingAnimations.removeIf(CommonProxy.this::removeAnimation);
|
||||
serverPlayingAnimations.removeIf(CommonProxy.this::removeAnimation);
|
||||
|
||||
try {
|
||||
clientPlayingAnimations.removeIf(CommonProxy.this::removeAnimation);
|
||||
serverPlayingAnimations.removeIf(CommonProxy.this::removeAnimation);
|
||||
} catch (ConcurrentModificationException ignored) {}
|
||||
}
|
||||
}});
|
||||
thread.setDaemon(true);
|
||||
|
||||
Reference in new issue
Block a user