@@ -1,6 +1,18 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -27,7 +27,8 @@
|
||||
@@ -54,13 +54,20 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.SharedConstants;
|
||||
+import net.minecraft.world.level.dimension.DimensionManager;
|
||||
+import net.minecraft.world.level.dimension.WorldDimension;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class Main {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
public Main() {}
|
||||
|
||||
@@ -10,7 +22,7 @@
|
||||
OptionParser optionparser = new OptionParser();
|
||||
OptionSpec<Void> optionspec = optionparser.accepts("nogui");
|
||||
OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
|
||||
@@ -51,20 +52,22 @@
|
||||
@@ -84,21 +91,23 @@
|
||||
optionparser.printHelpOn(System.err);
|
||||
return;
|
||||
}
|
||||
@@ -22,20 +34,25 @@
|
||||
DispenserRegistry.c();
|
||||
SystemUtils.l();
|
||||
IRegistryCustom.Dimension iregistrycustom_dimension = IRegistryCustom.b();
|
||||
java.nio.file.Path java_nio_file_path = Paths.get("server.properties");
|
||||
- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, java_nio_file_path);
|
||||
- Path path = Paths.get("server.properties");
|
||||
- DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, path);
|
||||
+ java.nio.file.Path java_nio_file_path = Paths.get("server.properties");
|
||||
+ DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, optionset); // CraftBukkit - CLI argument support
|
||||
|
||||
dedicatedserversettings.save();
|
||||
java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
|
||||
EULA eula = new EULA(java_nio_file_path1);
|
||||
- Path path1 = Paths.get("eula.txt");
|
||||
- EULA eula = new EULA(path1);
|
||||
+ java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
|
||||
+ EULA eula = new EULA(java_nio_file_path1);
|
||||
|
||||
- if (optionset.has(optionspec1)) {
|
||||
- Main.LOGGER.info("Initialized '{}' and '{}'", path.toAbsolutePath(), path1.toAbsolutePath());
|
||||
+ if (optionset.has("initSettings")) { // CraftBukkit
|
||||
Main.LOGGER.info("Initialized '{}' and '{}'", java_nio_file_path.toAbsolutePath(), java_nio_file_path1.toAbsolutePath());
|
||||
+ Main.LOGGER.info("Initialized '{}' and '{}'", java_nio_file_path.toAbsolutePath(), java_nio_file_path1.toAbsolutePath());
|
||||
return;
|
||||
}
|
||||
@@ -74,24 +77,42 @@
|
||||
|
||||
@@ -107,24 +116,42 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,7 +99,7 @@
|
||||
DataPackConfiguration datapackconfiguration1 = MinecraftServer.a(resourcepackrepository, datapackconfiguration == null ? DataPackConfiguration.a : datapackconfiguration, flag);
|
||||
CompletableFuture completablefuture = DataPackResources.a(resourcepackrepository.f(), CommandDispatcher.ServerType.DEDICATED, dedicatedserversettings.getProperties().functionPermissionLevel, SystemUtils.f(), Runnable::run);
|
||||
|
||||
@@ -106,6 +127,7 @@
|
||||
@@ -139,6 +166,7 @@
|
||||
}
|
||||
|
||||
datapackresources.i();
|
||||
@@ -90,7 +107,7 @@
|
||||
RegistryReadOps<NBTBase> registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, datapackresources.h(), iregistrycustom_dimension);
|
||||
Object object = convertable_conversionsession.a((DynamicOps) registryreadops, datapackconfiguration1);
|
||||
|
||||
@@ -133,21 +155,32 @@
|
||||
@@ -166,21 +194,32 @@
|
||||
}
|
||||
|
||||
convertable_conversionsession.a((IRegistryCustom) iregistrycustom_dimension, (SaveData) object);
|
||||
@@ -125,7 +142,7 @@
|
||||
Thread thread = new Thread("Server Shutdown Thread") {
|
||||
public void run() {
|
||||
dedicatedserver.safeShutdown(true);
|
||||
@@ -156,14 +189,15 @@
|
||||
@@ -189,14 +228,15 @@
|
||||
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
|
||||
Runtime.getRuntime().addShutdownHook(thread);
|
||||
|
||||
Reference in New Issue
Block a user