From 1fab122da38d0d5a6d60156a419faee3a62043dd Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 27 Dec 2020 21:25:08 +0100 Subject: [PATCH] Fasten your seatbelts! Under 10s! --- .../Dont_search_disambiguities.patch | 18 +++++ .../Load_DispenserRegistry_async.patch | 66 +++++++++++++++++++ SteamWar-Patches/Load_Plugins_async.patch | 40 +++++++++++ 3 files changed, 124 insertions(+) create mode 100644 SteamWar-Patches/Dont_search_disambiguities.patch create mode 100644 SteamWar-Patches/Load_DispenserRegistry_async.patch create mode 100644 SteamWar-Patches/Load_Plugins_async.patch diff --git a/SteamWar-Patches/Dont_search_disambiguities.patch b/SteamWar-Patches/Dont_search_disambiguities.patch new file mode 100644 index 0000000..c61e9a9 --- /dev/null +++ b/SteamWar-Patches/Dont_search_disambiguities.patch @@ -0,0 +1,18 @@ +Index: src/main/java/net/minecraft/server/CommandDispatcher.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 2092b553cf3dbfc5fbe5534ac1bfd42e2c90a9fc) ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1609100118789) +@@ -108,9 +108,6 @@ + CommandWhitelist.a(this.b); + } + +- this.b.findAmbiguities((commandnode, commandnode1, commandnode2, collection) -> { +- // CommandDispatcher.LOGGER.warn("Ambiguity between arguments {} and {} with inputs: {}", this.b.getPath(commandnode1), this.b.getPath(commandnode2), collection); // CraftBukkit +- }); + return this; + } + diff --git a/SteamWar-Patches/Load_DispenserRegistry_async.patch b/SteamWar-Patches/Load_DispenserRegistry_async.patch new file mode 100644 index 0000000..533c783 --- /dev/null +++ b/SteamWar-Patches/Load_DispenserRegistry_async.patch @@ -0,0 +1,66 @@ +Index: src/main/java/net/minecraft/server/CommandDispatcher.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java +--- a/src/main/java/net/minecraft/server/CommandDispatcher.java (revision 2092b553cf3dbfc5fbe5534ac1bfd42e2c90a9fc) ++++ b/src/main/java/net/minecraft/server/CommandDispatcher.java (date 1609100118789) +@@ -35,7 +35,6 @@ + // CraftBukkit start + public final CommandDispatcher init(boolean flag) { + CommandAdvancement.a(this.b); +- CommandExecute.a(this.b); + CommandBossBar.a(this.b); + CommandClear.a(this.b); + CommandClone.a(this.b); +@@ -48,7 +47,6 @@ + CommandMe.a(this.b); + CommandEnchant.a(this.b); + CommandXp.a(this.b); +- CommandFill.a(this.b); + CommandForceload.a(this.b); + CommandFunction.a(this.b); + CommandGamemode.a(this.b); +Index: src/main/java/net/minecraft/server/MinecraftServer.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +--- a/src/main/java/net/minecraft/server/MinecraftServer.java (revision 2092b553cf3dbfc5fbe5534ac1bfd42e2c90a9fc) ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java (date 1609100120517) +@@ -175,11 +175,18 @@ + public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); + // Spigot end + ++ protected static Thread dispenserRegistryInit; ++ + public MinecraftServer(OptionSet options, Proxy proxy, DataFixer datafixer, CommandDispatcher commanddispatcher, YggdrasilAuthenticationService yggdrasilauthenticationservice, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory, String s) { + super("Server"); + this.ae = new ResourceManager(EnumResourcePackType.SERVER_DATA, this.serverThread); + this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new); + this.craftingManager = new CraftingManager(); ++ try { ++ dispenserRegistryInit.join(); ++ } catch (InterruptedException e) { ++ Thread.currentThread().interrupt(); ++ } + this.tagRegistry = new TagRegistry(); + this.scoreboardServer = new ScoreboardServer(this); + this.bossBattleCustomData = new BossBattleCustomData(this); +@@ -1185,8 +1192,12 @@ + } + + CrashReport.h(); +- DispenserRegistry.init(); +- DispenserRegistry.c(); ++ dispenserRegistryInit = new Thread(() -> { ++ DispenserRegistry.init(); ++ DispenserRegistry.c(); ++ }); ++ dispenserRegistryInit.start(); ++ + File s = (File) optionset.valueOf("universe"); // CraftBukkit + YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); + MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService(); diff --git a/SteamWar-Patches/Load_Plugins_async.patch b/SteamWar-Patches/Load_Plugins_async.patch new file mode 100644 index 0000000..07f95e7 --- /dev/null +++ b/SteamWar-Patches/Load_Plugins_async.patch @@ -0,0 +1,40 @@ +Index: src/main/java/org/bukkit/craftbukkit/CraftServer.java +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java (revision 2092b553cf3dbfc5fbe5534ac1bfd42e2c90a9fc) ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (date 1609100597313) +@@ -351,13 +351,25 @@ + + if (pluginFolder.exists()) { + Plugin[] plugins = pluginManager.loadPlugins(pluginFolder); ++ List threads = new ArrayList<>(); + for (Plugin plugin : plugins) { +- try { +- String message = String.format("Loading %s", plugin.getDescription().getFullName()); +- plugin.getLogger().info(message); +- plugin.onLoad(); +- } catch (Throwable ex) { +- Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); ++ Thread thread = new Thread(() -> { ++ try { ++ String message = String.format("Loading %s", plugin.getDescription().getFullName()); ++ plugin.getLogger().info(message); ++ plugin.onLoad(); ++ } catch (Throwable ex) { ++ Logger.getLogger(CraftServer.class.getName()).log(Level.SEVERE, ex.getMessage() + " initializing " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); ++ } ++ }); ++ thread.start(); ++ threads.add(thread); ++ } ++ for(Thread thread : threads){ ++ try { ++ thread.join(); ++ } catch (InterruptedException e) { ++ Thread.currentThread().interrupt(); + } + } + } else {