Archiviert
13
0
Dieses Repository wurde am 2021-12-14 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
SteamSpigot/Paper/SteamWar-Patches/0562-Load-DispenserRegistry-async-paper.patch

73 Zeilen
3.8 KiB
Diff

2021-04-14 17:34:29 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zeanon <thezeanon@gmail.com>
Date: Wed, 14 Apr 2021 16:27:59 +0200
Subject: [PATCH] Load DispenserRegistry async paper
2020-12-27 21:25:08 +01:00
diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java
2021-04-14 17:34:29 +02:00
index 7c988a12d6dc40f21c02cb47928253a4434876e7..90b20db687583e49747ea3159add1baa61280a31 100644
--- a/src/main/java/net/minecraft/server/CommandDispatcher.java
+++ b/src/main/java/net/minecraft/server/CommandDispatcher.java
@@ -35,7 +35,7 @@ public class CommandDispatcher {
2020-12-27 21:25:08 +01:00
// CraftBukkit start
public final CommandDispatcher init(boolean flag) {
CommandAdvancement.a(this.b);
- CommandExecute.a(this.b);
2021-04-12 19:54:42 +02:00
+ //CommandExecute.a(this.b); //Steamwar
2020-12-27 21:25:08 +01:00
CommandBossBar.a(this.b);
CommandClear.a(this.b);
CommandClone.a(this.b);
2021-04-14 17:34:29 +02:00
@@ -48,7 +48,7 @@ public class CommandDispatcher {
2020-12-27 21:25:08 +01:00
CommandMe.a(this.b);
CommandEnchant.a(this.b);
CommandXp.a(this.b);
- CommandFill.a(this.b);
2021-04-12 19:54:42 +02:00
+ //CommandFill.a(this.b); //Steamwar
2020-12-27 21:25:08 +01:00
CommandForceload.a(this.b);
CommandFunction.a(this.b);
CommandGamemode.a(this.b);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
2021-04-14 17:34:29 +02:00
index 5c71efe494faaf7427f82036d60cc81447e4b12c..098b2ef32823c45983c0639393d76868f1e4d949 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -187,12 +187,21 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
2020-12-27 21:25:08 +01:00
public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant();
// Spigot end
2021-04-12 19:54:42 +02:00
+ protected static Thread dispenserRegistryInit; //Steamwar
2020-12-27 21:25:08 +01:00
+
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);
2021-04-12 19:54:42 +02:00
SERVER = this; // Paper - better singleton
2020-12-27 21:25:08 +01:00
this.resourcePackRepository = new ResourcePackRepository<>(ResourcePackLoader::new);
this.craftingManager = new CraftingManager();
2021-04-12 19:54:42 +02:00
+ //Steamwar Start
2020-12-27 21:25:08 +01:00
+ try {
+ dispenserRegistryInit.join();
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
2021-04-12 19:54:42 +02:00
+ //Steamwar End
2020-12-27 21:25:08 +01:00
this.tagRegistry = new TagRegistry();
this.scoreboardServer = new ScoreboardServer(this);
this.bossBattleCustomData = new BossBattleCustomData(this);
2021-04-14 17:34:29 +02:00
@@ -1434,8 +1443,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
2020-12-27 21:25:08 +01:00
}
CrashReport.h();
- DispenserRegistry.init();
- DispenserRegistry.c();
2021-04-12 19:54:42 +02:00
+ //Steamwar Start
+ //DispenserRegistry.init();
+ //DispenserRegistry.c();
2020-12-27 21:25:08 +01:00
+ dispenserRegistryInit = new Thread(() -> {
+ DispenserRegistry.init();
+ DispenserRegistry.c();
+ });
+ dispenserRegistryInit.start();
2021-04-12 19:54:42 +02:00
+ //Steamwar End
2020-12-27 21:25:08 +01:00
File s = (File) optionset.valueOf("universe"); // CraftBukkit
2021-04-12 19:54:42 +02:00
YggdrasilAuthenticationService yggdrasilauthenticationservice = new com.destroystokyo.paper.profile.PaperAuthenticationService(Proxy.NO_PROXY, UUID.randomUUID().toString()); // Paper
2020-12-27 21:25:08 +01:00
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();