mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
43 lines
2.3 KiB
Diff
43 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
Date: Mon, 13 May 2019 21:10:59 -0700
|
|
Subject: [PATCH] Fix CraftServer#isPrimaryThread and MinecraftServer
|
|
isMainThread
|
|
|
|
md_5 changed it so he could shut down the server asynchronously
|
|
from watchdog, although we have patches that prevent that type
|
|
of behavior for this exact reason.
|
|
|
|
md_5 also placed code in PlayerConnectionUtils that would have
|
|
solved https://bugs.mojang.com/browse/MC-142590, making the change
|
|
to MinecraftServer#isMainThread irrelevant.
|
|
By reverting his change to MinecraftServer#isMainThread packet
|
|
handling that should have been handled synchronously will be handled
|
|
synchronously when the server gets shut down.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index bc9937642a46ecd766a45ccb037de993dafa3608..bd8e654c1580a0ac7dd411b9f1dcad4a20d1d3e5 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -2287,7 +2287,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
// CraftBukkit start
|
|
@Override
|
|
public boolean isSameThread() {
|
|
- return super.isSameThread() || this.isStopped(); // CraftBukkit - MC-142590
|
|
+ return super.isSameThread() /*|| this.isStopped()*/; // CraftBukkit - MC-142590 // Paper - causes issues elsewhere
|
|
}
|
|
|
|
public boolean isDebugging() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 0e8b290f92c0d66968fd9428aac19ca233dfdde1..1f7ac7b4d2d26ecf1f3ab8f5eec0e0e2dcc679c1 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2040,7 +2040,7 @@ public final class CraftServer implements Server {
|
|
|
|
@Override
|
|
public boolean isPrimaryThread() {
|
|
- return Thread.currentThread().equals(console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog)
|
|
+ return Thread.currentThread().equals(console.serverThread); // Paper - Fix issues with detecting main thread properly
|
|
}
|
|
|
|
// Paper start
|