mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-01 16:20:26 +01:00
Only add TickListener instances once.
This commit is contained in:
parent
de5f152df9
commit
d15a1d1f9e
@ -175,9 +175,11 @@ public class TickTask implements Runnable {
|
|||||||
public static void addTickListener(TickListener listener){
|
public static void addTickListener(TickListener listener){
|
||||||
synchronized (tickListeners) {
|
synchronized (tickListeners) {
|
||||||
if (locked) return;
|
if (locked) return;
|
||||||
|
if (!tickListeners.contains(listener)){
|
||||||
tickListeners.add(listener);
|
tickListeners.add(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a tick listener. Should be thread safe, though... why?
|
* Remove a tick listener. Should be thread safe, though... why?
|
||||||
|
Loading…
Reference in New Issue
Block a user