Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
@@ -55,6 +55,18 @@
@@ -155,6 +155,25 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -10,6 +10,13 @@
+import com.google.common.collect.ImmutableSet;
+import jline.console.ConsoleReader;
+import joptsimple.OptionSet;
+import net.minecraft.nbt.DynamicOpsNBT;
+import net.minecraft.nbt.NBTBase;
+import net.minecraft.resources.RegistryReadOps;
+import net.minecraft.server.dedicated.DedicatedServer;
+import net.minecraft.server.dedicated.DedicatedServerProperties;
+import net.minecraft.util.datafix.DataConverterRegistry;
+import net.minecraft.world.level.storage.WorldDataServer;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.Main;
@@ -19,7 +26,7 @@
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
public static final Logger LOGGER = LogManager.getLogger();
@@ -124,6 +136,20 @@
@@ -224,6 +243,20 @@
private final DefinedStructureManager ak;
protected SaveData saveData;
@@ -40,7 +47,7 @@
public static <S extends MinecraftServer> S a(Function<Thread, S> function) {
AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new Thread(() -> {
@@ -133,21 +159,21 @@
@@ -233,21 +266,21 @@
thread.setUncaughtExceptionHandler((thread1, throwable) -> {
MinecraftServer.LOGGER.error(throwable);
});
@@ -65,7 +72,7 @@
this.isRunning = true;
this.h = new long[100];
this.K = "";
@@ -173,7 +199,34 @@
@@ -273,7 +306,34 @@
this.ak = new DefinedStructureManager(datapackresources.h(), convertable_conversionsession, datafixer);
this.serverThread = thread;
this.executorService = SystemUtils.f();
@@ -100,7 +107,7 @@
private void initializeScoreboards(WorldPersistentData worldpersistentdata) {
PersistentScoreboard persistentscoreboard = (PersistentScoreboard) worldpersistentdata.a(PersistentScoreboard::new, "scoreboard");
@@ -186,7 +239,7 @@
@@ -286,7 +346,7 @@
public static void convertWorld(Convertable.ConversionSession convertable_conversionsession) {
if (convertable_conversionsession.isConvertable()) {
@@ -109,7 +116,7 @@
convertable_conversionsession.convert(new IProgressUpdate() {
private long a = SystemUtils.getMonotonicMillis();
@@ -209,45 +262,184 @@
@@ -309,45 +369,184 @@
}
@@ -325,7 +332,7 @@
WorldBorder worldborder = worldserver.getWorldBorder();
worldborder.a(iworlddataserver.r());
@@ -272,31 +464,8 @@
@@ -372,31 +571,8 @@
iworlddataserver.c(true);
}
@@ -358,7 +365,7 @@
private static void a(WorldServer worldserver, IWorldDataServer iworlddataserver, boolean flag, boolean flag1, boolean flag2) {
ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator();
@@ -312,6 +481,21 @@
@@ -412,6 +588,21 @@
return biomebase.b().b();
}, random);
ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition);
@@ -380,7 +387,7 @@
if (blockposition == null) {
MinecraftServer.LOGGER.warn("Unable to find spawn biome");
@@ -378,8 +562,15 @@
@@ -478,8 +669,15 @@
iworlddataserver.setGameType(EnumGamemode.SPECTATOR);
}
@@ -398,7 +405,7 @@
MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a());
BlockPosition blockposition = worldserver.getSpawn();
@@ -392,17 +583,21 @@
@@ -492,17 +690,21 @@
chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE);
while (chunkproviderserver.b() != 441) {
@@ -429,7 +436,7 @@
if (forcedchunk != null) {
LongIterator longiterator = forcedchunk.a().iterator();
@@ -416,11 +611,18 @@
@@ -516,11 +718,18 @@
}
}
@@ -451,7 +458,7 @@
}
protected void loadResourcesZip() {
@@ -465,12 +667,16 @@
@@ -565,12 +774,16 @@
worldserver.save((IProgressUpdate) null, flag1, worldserver.savingDisabled && !flag2);
}
@@ -468,7 +475,7 @@
return flag3;
}
@@ -479,8 +685,29 @@
@@ -579,8 +792,29 @@
this.stop();
}
@@ -498,7 +505,7 @@
if (this.getServerConnection() != null) {
this.getServerConnection().b();
}
@@ -489,6 +716,7 @@
@@ -589,6 +823,7 @@
MinecraftServer.LOGGER.info("Saving players");
this.playerList.savePlayers();
this.playerList.shutdown();
@@ -506,7 +513,7 @@
}
MinecraftServer.LOGGER.info("Saving worlds");
@@ -566,14 +794,16 @@
@@ -666,14 +901,16 @@
while (this.isRunning) {
long i = SystemUtils.getMonotonicMillis() - this.nextTick;
@@ -524,7 +531,7 @@
this.nextTick += 50L;
GameProfilerTick gameprofilertick = GameProfilerTick.a("Server");
@@ -619,6 +849,12 @@
@@ -719,6 +956,12 @@
} catch (Throwable throwable1) {
MinecraftServer.LOGGER.error("Exception stopping the server", throwable1);
} finally {
@@ -537,7 +544,7 @@
this.exit();
}
@@ -627,8 +863,15 @@
@@ -727,8 +970,15 @@
}
private boolean canSleepForTick() {
@@ -554,7 +561,7 @@
protected void sleepForTick() {
this.executeAll();
@@ -734,7 +977,7 @@
@@ -834,7 +1084,7 @@
this.serverPing.b().a(agameprofile);
}
@@ -563,7 +570,7 @@
MinecraftServer.LOGGER.debug("Autosave started");
this.methodProfiler.enter("save");
this.playerList.savePlayers();
@@ -764,22 +1007,39 @@
@@ -864,22 +1114,39 @@
}
protected void b(BooleanSupplier booleansupplier) {
@@ -603,7 +610,7 @@
this.methodProfiler.enter("tick");
@@ -863,7 +1123,7 @@
@@ -963,7 +1230,7 @@
}
public String getServerModName() {
@@ -612,7 +619,7 @@
}
public CrashReport b(CrashReport crashreport) {
@@ -1220,16 +1480,17 @@
@@ -1320,16 +1587,17 @@
public CompletableFuture<Void> a(Collection<String> collection) {
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
@@ -632,7 +639,7 @@
this.resourcePackRepository.a(collection);
this.saveData.a(a(this.resourcePackRepository));
datapackresources.i();
@@ -1595,6 +1856,22 @@
@@ -1695,6 +1963,22 @@
}