Exit with non-zero exit code when killed by watchdog (#5732)
This commit is contained in:
parent
a8d7ad0995
commit
3f72a549b0
|
@ -83,7 +83,7 @@ index 397194b3e90c9df39cfae17b401c7ac891b0dbb7..61b4c42e95994343772a91640b243b8e
|
|||
a(SystemUtils.e);
|
||||
a(SystemUtils.f);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2cc7eec74 100644
|
||||
index 506edef56ef6012424556f058996dbf690d4bae7..11a412b1df98dea2826330b0b246655844a4f4ea 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -271,7 +271,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
@ -95,16 +95,17 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
// CraftBukkit end
|
||||
// Spigot start
|
||||
public static final int TPS = 20;
|
||||
@@ -281,6 +281,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -281,6 +281,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
|
||||
// Spigot end
|
||||
|
||||
+ public volatile Thread shutdownThread; // Paper
|
||||
+ public volatile boolean abnormalExit = false; // Paper
|
||||
+
|
||||
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new Thread(() -> {
|
||||
@@ -853,6 +855,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -853,6 +856,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
||||
// CraftBukkit start
|
||||
private boolean hasStopped = false;
|
||||
|
@ -112,7 +113,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
private final Object stopLock = new Object();
|
||||
public final boolean hasStopped() {
|
||||
synchronized (stopLock) {
|
||||
@@ -867,6 +870,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -867,6 +871,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (hasStopped) return;
|
||||
hasStopped = true;
|
||||
}
|
||||
|
@ -136,7 +137,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
// CraftBukkit end
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
MinecraftTimings.stopServer(); // Paper
|
||||
@@ -932,7 +952,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -932,7 +953,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.getUserCache().b(false); // Paper
|
||||
}
|
||||
// Spigot end
|
||||
|
@ -155,7 +156,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
}
|
||||
|
||||
public String getServerIp() {
|
||||
@@ -1025,6 +1056,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1025,6 +1057,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
||||
protected void w() {
|
||||
try {
|
||||
|
@ -163,7 +164,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
if (this.init()) {
|
||||
this.nextTick = SystemUtils.getMonotonicMillis();
|
||||
this.serverPing.setMOTD(new ChatComponentText(this.motd));
|
||||
@@ -1032,6 +1064,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1032,6 +1065,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.a(this.serverPing);
|
||||
|
||||
// Spigot start
|
||||
|
@ -182,7 +183,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
org.spigotmc.WatchdogThread.hasStarted = true; // Paper
|
||||
Arrays.fill( recentTps, 20 );
|
||||
long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
|
||||
@@ -1087,6 +1131,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1087,6 +1132,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.a((CrashReport) null);
|
||||
}
|
||||
} catch (Throwable throwable) {
|
||||
|
@ -195,7 +196,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
|
||||
// Spigot Start
|
||||
if ( throwable.getCause() != null )
|
||||
@@ -1118,14 +1168,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1118,14 +1169,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
} catch (Throwable throwable1) {
|
||||
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
|
||||
} finally {
|
||||
|
@ -213,7 +214,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
}
|
||||
|
||||
}
|
||||
@@ -1181,6 +1231,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1181,6 +1232,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
|
||||
@Override
|
||||
public TickTask postToMainThread(Runnable runnable) {
|
||||
|
@ -226,7 +227,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
return new TickTask(this.ticks, runnable);
|
||||
}
|
||||
|
||||
@@ -1423,6 +1479,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1423,6 +1480,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
try {
|
||||
crashreport = CrashReport.a(throwable, "Exception ticking world");
|
||||
} catch (Throwable t) {
|
||||
|
@ -234,7 +235,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
throw new RuntimeException("Error generating crash report", t);
|
||||
}
|
||||
// Spigot End
|
||||
@@ -1880,7 +1937,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1880,7 +1938,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.resourcePackRepository.a(collection);
|
||||
this.saveData.a(a(this.resourcePackRepository));
|
||||
datapackresources.i();
|
||||
|
@ -245,7 +246,7 @@ index 506edef56ef6012424556f058996dbf690d4bae7..0498c62d695d627db26d8c932562f0e2
|
|||
this.customFunctionData.a(this.dataPackResources.a());
|
||||
this.ak.a(this.dataPackResources.h());
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 557f80accfa36b495c9a8cffdab2e248c1cbb514..ec1f36736d79d4054ad7ff4da4e3659f35c811d6 100644
|
||||
index 557f80accfa36b495c9a8cffdab2e248c1cbb514..29eda296e7ebfbe1f19b7e515401ea85994df833 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -279,7 +279,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
@ -257,14 +258,16 @@ index 557f80accfa36b495c9a8cffdab2e248c1cbb514..ec1f36736d79d4054ad7ff4da4e3659f
|
|||
if (dedicatedserverproperties.announcePlayerAchievements != null) {
|
||||
((GameRules.GameRuleBoolean) this.getGameRules().get(GameRules.ANNOUNCE_ADVANCEMENTS)).a(dedicatedserverproperties.announcePlayerAchievements, (MinecraftServer) this);
|
||||
}
|
||||
@@ -407,6 +407,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@@ -407,7 +407,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
//this.remoteStatusListener.b(); // Paper - don't wait for remote connections
|
||||
}
|
||||
|
||||
- System.exit(0); // CraftBukkit
|
||||
+ hasFullyShutdown = true; // Paper
|
||||
System.exit(0); // CraftBukkit
|
||||
+ System.exit(this.abnormalExit ? 70 : 0); // CraftBukkit // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -740,7 +741,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
@Override
|
||||
public void stop() {
|
||||
|
@ -519,7 +522,7 @@ index b45d7e5c108c7a8541fcbc9ad92d1a79a94746a1..6a408dc9286a60c3ca7830f88171919f
|
|||
String[] split = restartScript.split( " " );
|
||||
if ( split.length > 0 && new File( split[0] ).isFile() )
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index 58e50bf0fb0f309227e1f4c1f6bb11c01d8e08d3..30a665c090f419985e1d0f49df9e8d110c83943a 100644
|
||||
index 58e50bf0fb0f309227e1f4c1f6bb11c01d8e08d3..c58de4de8d98c6b1e79d83cc7fcd46a7590ed2a0 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -13,6 +13,7 @@ import org.bukkit.Bukkit;
|
||||
|
@ -564,7 +567,7 @@ index 58e50bf0fb0f309227e1f4c1f6bb11c01d8e08d3..30a665c090f419985e1d0f49df9e8d11
|
|||
log.log( Level.SEVERE, "------------------------------" );
|
||||
//
|
||||
// Paper start - Only print full dump on long timeouts
|
||||
@@ -139,9 +142,24 @@ public class WatchdogThread extends Thread
|
||||
@@ -139,9 +142,25 @@ public class WatchdogThread extends Thread
|
||||
|
||||
if ( isLongTimeout )
|
||||
{
|
||||
|
@ -579,6 +582,7 @@ index 58e50bf0fb0f309227e1f4c1f6bb11c01d8e08d3..30a665c090f419985e1d0f49df9e8d11
|
|||
+ RestartCommand.addShutdownHook( SpigotConfig.restartScript );
|
||||
+ }
|
||||
+ // try one last chance to safe shutdown on main incase it 'comes back'
|
||||
+ server.abnormalExit = true;
|
||||
+ server.safeShutdown(false, restart);
|
||||
+ try {
|
||||
+ Thread.sleep(1000);
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Use distance map to optimise entity tracker
|
|||
Use the distance map to find candidate players for tracking.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 6f51409bac9c2907a5be02e4c15319fcc520609f..e25539dd54956225e8b14d3b8c636130267f226d 100644
|
||||
index 11a412b1df98dea2826330b0b246655844a4f4ea..1d77d6254b024c286781be8dc74680bc1e8f1238 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1653,6 +1653,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1654,6 +1654,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns
|
|||
if any are still running after that delay just as reload does.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1e7b3a14210edf453de9c1d9ebbb22be5d9f7a7a..1df2ff45edb4c71bf68ae37fe1cb0e5438e0373d 100644
|
||||
index 1d77d6254b024c286781be8dc74680bc1e8f1238..bc45d15091282f30f7d147aed4e72b4e1ae9f440 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -893,6 +893,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -894,6 +894,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
// CraftBukkit start
|
||||
if (this.server != null) {
|
||||
this.server.disablePlugins();
|
||||
|
|
|
@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead
|
|||
of restoring the server.properties every single load.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1df2ff45edb4c71bf68ae37fe1cb0e5438e0373d..fc7be7e32c28f20913f5bfc7d23967d61f2b944f 100644
|
||||
index bc45d15091282f30f7d147aed4e72b4e1ae9f440..f26a17228f724906bfcaeba5a28daf7d9cc3d2b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1646,11 +1646,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1647,11 +1647,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ index 1773fa44f55c6f6dcda0afceff4db39881861879..4a43b4632a5cb1e3b5659c9c6c44b42d
|
|||
return 0;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index ec1f36736d79d4054ad7ff4da4e3659f35c811d6..c4df472050622eb2469b2ddb4d2ed917994f6e95 100644
|
||||
index 69490f3a9f3099893c88ef399579ee3007309b5b..eb4aa514ecd6c4d6c0dc4016001c632f0943ea81 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -362,7 +362,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
|
||||
|
|
|
@ -25,10 +25,10 @@ index b67ba8f75e4a3358d7c2462918b85b0bf9b5a922..fdbd8b89bb8bf3b61f60b812b90483c9
|
|||
+ }
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index c3635577b1796e6ca84709469ecf95c815fe53a5..bd6b9c7be8951393e7ba731f4d6a9486f0743be7 100644
|
||||
index f26a17228f724906bfcaeba5a28daf7d9cc3d2b0..f2b1d15479bf1a0e510c3416a4d520149d439085 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1348,9 +1348,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1349,9 +1349,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
//if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit // Paper - move down
|
||||
//MinecraftServer.LOGGER.debug("Autosave started"); // Paper
|
||||
serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index bd6b9c7be8951393e7ba731f4d6a9486f0743be7..040933a25f1fa88e86b19ea20f519488af6a2740 100644
|
||||
index f2b1d15479bf1a0e510c3416a4d520149d439085..d3659f056ae3140921c379e153e765fadca212e3 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1954,6 +1954,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1955,6 +1955,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.getPlayerList().reload();
|
||||
this.customFunctionData.a(this.dataPackResources.a());
|
||||
this.ak.a(this.dataPackResources.h());
|
||||
|
|
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 040933a25f1fa88e86b19ea20f519488af6a2740..2834af3e0ff2ae8466fde191a64bf719242f67f3 100644
|
||||
index d3659f056ae3140921c379e153e765fadca212e3..169e50d55e7017b64ec037b93eb6b05b8716981f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2019,6 +2019,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -2020,6 +2020,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (this.aN()) {
|
||||
PlayerList playerlist = commandlistenerwrapper.getServer().getPlayerList();
|
||||
WhiteList whitelist = playerlist.getWhitelist();
|
||||
|
|
|
@ -59,7 +59,7 @@ index 0000000000000000000000000000000000000000..fdf3ff8894e5e202229d1be52fe3c92e
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 2834af3e0ff2ae8466fde191a64bf719242f67f3..13aac7efac8bfc8ea685621c942c310fdf2496d9 100644
|
||||
index 169e50d55e7017b64ec037b93eb6b05b8716981f..138ea4c3e4a1ed2426d9b9f40026b5dc0617c76d 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -182,6 +182,7 @@ import org.bukkit.event.server.ServerLoadEvent;
|
||||
|
@ -70,7 +70,7 @@ index 2834af3e0ff2ae8466fde191a64bf719242f67f3..13aac7efac8bfc8ea685621c942c310f
|
|||
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
||||
|
||||
@@ -1076,6 +1077,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1077,6 +1078,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
LOGGER.info("Done ({})! For help, type \"help\"", doneTime);
|
||||
// Paper end
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 13aac7efac8bfc8ea685621c942c310fdf2496d9..1c17db3e9e30d16bc5778bb3220e3e9e8c336258 100644
|
||||
index 138ea4c3e4a1ed2426d9b9f40026b5dc0617c76d..c2a2a14164d2431413c773fb5944ad68a8f6ad6b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2,9 +2,6 @@ package net.minecraft.server;
|
||||
|
@ -26,7 +26,7 @@ index 13aac7efac8bfc8ea685621c942c310fdf2496d9..1c17db3e9e30d16bc5778bb3220e3e9e
|
|||
|
||||
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
|
||||
|
||||
@@ -1935,7 +1933,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1936,7 +1934,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
return this.customFunctionData;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ index 13aac7efac8bfc8ea685621c942c310fdf2496d9..1c17db3e9e30d16bc5778bb3220e3e9e
|
|||
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
|
||||
Stream<String> stream = collection.stream(); // CraftBukkit - decompile error
|
||||
ResourcePackRepository resourcepackrepository = this.resourcePackRepository;
|
||||
@@ -1951,6 +1955,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1952,6 +1956,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
this.resourcePackRepository.a(collection);
|
||||
this.saveData.a(a(this.resourcePackRepository));
|
||||
datapackresources.i();
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] EntityMoveEvent
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 1c17db3e9e30d16bc5778bb3220e3e9e8c336258..952d5c7c3324377e0036b9d7e524484cb581e5b2 100644
|
||||
index c2a2a14164d2431413c773fb5944ad68a8f6ad6b..f8446fd716a891a0b71675ccee6a6eac55fba87c 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -13,6 +13,7 @@ import io.netty.buffer.ByteBuf;
|
||||
|
@ -16,7 +16,7 @@ index 1c17db3e9e30d16bc5778bb3220e3e9e8c336258..952d5c7c3324377e0036b9d7e524484c
|
|||
import it.unimi.dsi.fastutil.longs.LongIterator;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedWriter;
|
||||
@@ -1459,6 +1460,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -1460,6 +1461,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
while (iterator.hasNext()) {
|
||||
WorldServer worldserver = (WorldServer) iterator.next();
|
||||
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
|
||||
|
@ -25,7 +25,7 @@ index 1c17db3e9e30d16bc5778bb3220e3e9e8c336258..952d5c7c3324377e0036b9d7e524484c
|
|||
|
||||
this.methodProfiler.a(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
index 530963c1435985e17d0e3181c2d8affe003f81de..c7a661d4f43fad04ebada1bbebf4e4274fc9c452 100644
|
||||
index ac62e4e6842a474a1284ae7ac8890cc00b55aa64..9720f60d6a58df5f5a9b2c92e2209537aab7f010 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
|
||||
@@ -213,6 +213,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||
|
@ -37,7 +37,7 @@ index 530963c1435985e17d0e3181c2d8affe003f81de..c7a661d4f43fad04ebada1bbebf4e427
|
|||
return new Throwable(entity + " Added to world at " + new java.util.Date());
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityLiving.java b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
index deffd82dfca1d2eea6e5b8db9228015bf35ad0a3..21341eeb8148be119fbc1dd370c1beaf70a319e0 100644
|
||||
index b1adb0ddfeb94de6f92f40a7e9e586e00455160d..78d874c44cf8311af06b085db12fbe0cacd6cf7d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityLiving.java
|
||||
@@ -10,6 +10,7 @@ import com.mojang.datafixers.util.Pair;
|
||||
|
|
|
@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9
|
|||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d043b758a68a6afcc36880f255723413fab57c2a..c9a8b7bfc9cd33185d5abedb50ea1bef0bbde8f9 100644
|
||||
index f8446fd716a891a0b71675ccee6a6eac55fba87c..176a17582cb3b29a2ed430914ba8c0582bffe541 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -14,6 +14,7 @@ import io.netty.buffer.ByteBufOutputStream;
|
||||
|
@ -40,7 +40,7 @@ index d043b758a68a6afcc36880f255723413fab57c2a..c9a8b7bfc9cd33185d5abedb50ea1bef
|
|||
import it.unimi.dsi.fastutil.longs.LongIterator;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedWriter;
|
||||
@@ -856,6 +857,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -857,6 +858,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
// CraftBukkit start
|
||||
private boolean hasStopped = false;
|
||||
public volatile boolean hasFullyShutdown = false; // Paper
|
||||
|
@ -48,7 +48,7 @@ index d043b758a68a6afcc36880f255723413fab57c2a..c9a8b7bfc9cd33185d5abedb50ea1bef
|
|||
private final Object stopLock = new Object();
|
||||
public final boolean hasStopped() {
|
||||
synchronized (stopLock) {
|
||||
@@ -870,6 +872,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -871,6 +873,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
if (hasStopped) return;
|
||||
hasStopped = true;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ index d043b758a68a6afcc36880f255723413fab57c2a..c9a8b7bfc9cd33185d5abedb50ea1bef
|
|||
// Paper start - kill main thread, and kill it hard
|
||||
shutdownThread = Thread.currentThread();
|
||||
org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||
@@ -986,6 +989,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -987,6 +990,8 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
public void safeShutdown(boolean flag, boolean isRestarting) {
|
||||
this.isRunning = false;
|
||||
this.isRestarting = isRestarting;
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index a116156236caa22d3ee13b5a56f4ed3c8d013f37..35bb4d0b9ed131e6570cce0b43ae78c5557a0bff 100644
|
||||
index 176a17582cb3b29a2ed430914ba8c0582bffe541..d9ea784758fe52782042ce4b61faa915f895b3f8 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2041,7 +2041,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -2042,7 +2042,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
if (!whitelist.isWhitelisted(entityplayer.getProfile())) {
|
||||
|
|
|
@ -263,10 +263,10 @@ index bf4051349917cc1d727fc5544237e0291cb6f1e6..15b972b4a93b8fe3655acec47bc84b0f
|
|||
Main.LOGGER.info("Forcing world upgrade! {}", convertable_conversionsession.getLevelName()); // CraftBukkit
|
||||
WorldUpgrader worldupgrader = new WorldUpgrader(convertable_conversionsession, datafixer, immutableset, flag);
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d69ddb0236c8553cf63c4a007dfa7b87e8f58299..848219f43b2bcb2d79147107c68df52efd46d461 100644
|
||||
index d9ea784758fe52782042ce4b61faa915f895b3f8..ca8ca3ada9d8074a2b67c590a98c459563513ba6 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -514,13 +514,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -515,13 +515,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
worlddata = new WorldDataServer(worldsettings, generatorsettings, Lifecycle.stable());
|
||||
}
|
||||
worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
|
||||
|
@ -281,7 +281,7 @@ index d69ddb0236c8553cf63c4a007dfa7b87e8f58299..848219f43b2bcb2d79147107c68df52e
|
|||
|
||||
IWorldDataServer iworlddataserver = worlddata;
|
||||
GeneratorSettings generatorsettings = worlddata.getGeneratorSettings();
|
||||
@@ -540,6 +534,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -541,6 +535,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
chunkgenerator = worlddimension.c();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerKickEvent causes
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 848219f43b2bcb2d79147107c68df52efd46d461..d88ba18014087a5f945c1ea616b83a7df133e25c 100644
|
||||
index ca8ca3ada9d8074a2b67c590a98c459563513ba6..03823e95e1fbf465ff5b3b2c5743f1beb25de083 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2043,7 +2043,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
@@ -2044,7 +2044,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
|
||||
EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
|
||||
if (!whitelist.isWhitelisted(entityplayer.getProfile())) {
|
||||
|
|
Loading…
Reference in New Issue