Change MinecraftServer#pluginsBlockingSleep to be Set

A plugin should not be allowed to be added twice or more, as this
would require two or more remove calls to unset the pause block.
This commit is contained in:
Spottedleaf
2024-11-25 10:13:34 -08:00
parent cea5939bba
commit c9731fc93d
2 changed files with 325 additions and 324 deletions

View File

@@ -12,7 +12,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
+ private List<String> pluginsBlockingSleep = new ArrayList<>(); // Paper - API to allow/disallow tick sleeping
+ private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference();