fancynpcs: Fix tests

This commit is contained in:
Oliver
2025-09-02 21:30:02 +02:00
parent 0dd4af4811
commit 19bad7dabf
6 changed files with 155 additions and 86 deletions

View File

@@ -0,0 +1,19 @@
package de.oliver.plugintests.utils;
import java.util.concurrent.*;
public class Delay {
private static final ScheduledExecutorService EXECUTOR = Executors.newScheduledThreadPool(10);
public static void delay(Runnable runnable) {
ScheduledFuture<?> f = EXECUTOR.schedule(runnable, 10, TimeUnit.MILLISECONDS);
try {
f.get(100, TimeUnit.MILLISECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
System.out.println("Delay interrupted: " + e.getMessage());
}
}
}