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:
parent
cd9e697b52
commit
280b497783
2 changed files with 326 additions and 325 deletions
|
@ -5,14 +5,14 @@ Subject: [PATCH] API to allow/disallow tick sleeping
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 5d070f036dae6d93f863c55192b557419634456d..663b4ecd520e82aa108d44f2d5c2a20cfc7bc01f 100644
|
||||
index 5d070f036dae6d93f863c55192b557419634456d..c26e3a239441376f2694782d4f07943538677c71 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -332,6 +332,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue