From b1b9ab0df94c3b4b5c2613b7bf6347be10e864fc Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 26 Jul 2017 13:20:29 +1000 Subject: [PATCH] SPIGOT-3461: Standardise plugin load timing --- nms-patches/DedicatedServer.patch | 20 +++++++++++-------- .../org/bukkit/craftbukkit/CraftServer.java | 3 --- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch index 32e62d4c31..cce1ba0acb 100644 --- a/nms-patches/DedicatedServer.patch +++ b/nms-patches/DedicatedServer.patch @@ -108,16 +108,20 @@ this.r = new EULA(new File("eula.txt")); if (!this.r.a()) { DedicatedServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info."); -@@ -136,6 +183,8 @@ +@@ -136,6 +183,12 @@ return false; } -+ this.a((PlayerList) (new DedicatedPlayerList(this))); // CraftBukkit ++ // CraftBukkit start ++ this.a((PlayerList) (new DedicatedPlayerList(this))); ++ server.loadPlugins(); ++ server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); ++ // CraftBukkit end + if (!this.getOnlineMode()) { DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware."); -@@ -150,7 +199,7 @@ +@@ -150,7 +203,7 @@ if (!NameReferencingFileConverter.a(this.propertyManager)) { return false; } else { @@ -126,7 +130,7 @@ long j = System.nanoTime(); if (this.S() == null) { -@@ -198,7 +247,7 @@ +@@ -198,7 +251,7 @@ DedicatedServer.LOGGER.info("Done ({})! For help, type \"help\" or \"?\"", s3); if (this.propertyManager.a("announce-player-achievements")) { @@ -135,7 +139,7 @@ this.propertyManager.b("announce-player-achievements"); this.propertyManager.savePropertiesFile(); } -@@ -213,7 +262,18 @@ +@@ -213,7 +266,18 @@ DedicatedServer.LOGGER.info("Starting remote control listener"); this.p = new RemoteControlListener(this); this.p.a(); @@ -154,7 +158,7 @@ if (this.aT() > 0L) { Thread thread1 = new Thread(new ThreadWatchdog(this)); -@@ -298,11 +358,11 @@ +@@ -298,11 +362,11 @@ return crashreport; } @@ -168,7 +172,7 @@ super.D(); this.aP(); } -@@ -333,7 +393,15 @@ +@@ -333,7 +397,15 @@ while (!this.serverCommandQueue.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); @@ -185,7 +189,7 @@ } } -@@ -536,16 +604,70 @@ +@@ -536,16 +608,70 @@ } public String getPlugins() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 5eea272e30..89c1d3a2b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -256,9 +256,6 @@ public final class CraftServer implements Server { chunkGCPeriod = configuration.getInt("chunk-gc.period-in-ticks"); chunkGCLoadThresh = configuration.getInt("chunk-gc.load-threshold"); loadIcon(); - - loadPlugins(); - enablePlugins(PluginLoadOrder.STARTUP); } public boolean getCommandBlockOverride(String command) {