SteamWar/BauSystem
Archiviert
13
0

Fix ConcurrentModificationException #112

Manuell gemergt
Lixfel hat 1 Commits von FixTracer nach master 2020-11-15 12:05:12 +01:00 zusammengeführt
Nur Änderungen aus Commit 7a978a2f5b werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -40,26 +40,10 @@ public class TNTTracer {
private static final TraceCache traceCache = new TraceCache(); private static final TraceCache traceCache = new TraceCache();
public static void init(){ public static void init(){
Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), () -> { Bukkit.getScheduler().runTaskTimer(BauSystem.getPlugin(), TNTTracer::run, 0, 20);
synchronized (synchronizer) {
synchronizer.notifyAll();
}
}, 1, 20);
Bukkit.getScheduler().runTaskAsynchronously(BauSystem.getPlugin(), () -> {
while (true) {
synchronized (synchronizer) {
try {
synchronizer.wait();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
run();
}
});
} }
private static void run(){ private static void run() {
for (Player p : Bukkit.getOnlinePlayers()) { for (Player p : Bukkit.getOnlinePlayers()) {
if (DEBUG) { if (DEBUG) {
String actionBar = "§e" + TraceManager.getAllTraces().size() + " §cTraces §e" + ShowManager.get(p).getShowRadius() + " §cRadius"; String actionBar = "§e" + TraceManager.getAllTraces().size() + " §cTraces §e" + ShowManager.get(p).getShowRadius() + " §cRadius";