2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								--- a/net/minecraft/server/Main.java
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+++ b/net/minecraft/server/Main.java
  
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -58,6 +58,12 @@
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 import net.minecraft.world.level.storage.WorldInfo;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 import org.slf4j.Logger;
							 
						 
					
						
							
								
									
										
										
										
											2021-03-16 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+// CraftBukkit start
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+import java.util.concurrent.atomic.AtomicReference;
  
						 
					
						
							
								
									
										
										
										
											2021-03-16 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+import net.minecraft.SharedConstants;
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+import net.minecraft.world.level.dimension.WorldDimension;
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+// CraftBukkit end
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 public class Main {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     private static final Logger LOGGER = LogUtils.getLogger();
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -65,8 +71,9 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     public Main() {}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     @DontObfuscate
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-    public static void main(String[] astring) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+    public static void main(final OptionSet optionset) { // CraftBukkit - replaces main(String[] astring)
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								         SharedConstants.tryDetectVersion();
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								+        /* CraftBukkit start - Replace everything
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         OptionParser optionparser = new OptionParser();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         OptionSpec<Void> optionspec = optionparser.accepts("nogui");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         OptionSpec<Void> optionspec1 = optionparser.accepts("initSettings", "Initializes 'server.properties' and 'eula.txt', then quits");
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -91,9 +98,12 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                 optionparser.printHelpOn(System.err);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            */ // CraftBukkit end
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								+        try {
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             CrashReport.preload();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-            if (optionset.has(optionspec13)) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            if (optionset.has("jfrProfile")) { // CraftBukkit
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 JvmProfiler.INSTANCE.start(Environment.SERVER);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -101,13 +111,13 @@
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             DispenserRegistry.validate();
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             SystemUtils.startTimerHackThread();
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             Path path = Paths.get("server.properties");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-            DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(path);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             dedicatedserversettings.forceSave();
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             Path path1 = Paths.get("eula.txt");
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             EULA eula = new EULA(path1);
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-            if (optionset.has(optionspec1)) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            if (optionset.has("initSettings")) { // CraftBukkit
  
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                 Main.LOGGER.info("Initialized '{}' and '{}'", path.toAbsolutePath(), path1.toAbsolutePath());
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                 return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -117,11 +127,12 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                 return;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-            File file = new File((String) optionset.valueOf(optionspec9));
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            File file = (File) optionset.valueOf("universe"); // CraftBukkit
  
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             Services services = Services.create(new YggdrasilAuthenticationService(Proxy.NO_PROXY), file);
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-            String s = (String) Optional.ofNullable((String) optionset.valueOf(optionspec10)).orElse(dedicatedserversettings.getProperties().levelName);
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								+            // CraftBukkit start
  
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             Convertable convertable = Convertable.createDefault(file.toPath());
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-            Convertable.ConversionSession convertable_conversionsession = convertable.createAccess(s);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            Convertable.ConversionSession convertable_conversionsession = convertable.createAccess(s, WorldDimension.OVERWORLD);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             WorldInfo worldinfo = convertable_conversionsession.getSummary();
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             if (worldinfo != null) {
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -136,13 +147,32 @@
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                 }
							 
						 
					
						
							
								
									
										
										
										
											2021-06-11 15:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-            boolean flag = optionset.has(optionspec6);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            boolean flag = optionset.has("safeMode");
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             if (flag) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 Main.LOGGER.warn("Safe mode active, only vanilla datapack will be loaded");
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 12:24:35 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             ResourcePackRepository resourcepackrepository = new ResourcePackRepository(EnumResourcePackType.SERVER_DATA, new ResourcePackSource[]{new ResourcePackSourceVanilla(), new ResourcePackSourceFolder(convertable_conversionsession.getLevelPath(SavedFile.DATAPACK_DIR).toFile(), PackSource.WORLD)});
							 
						 
					
						
							
								
									
										
										
										
											2020-06-26 12:24:35 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            // CraftBukkit start
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            File bukkitDataPackFolder = new File(convertable_conversionsession.getLevelPath(SavedFile.DATAPACK_DIR).toFile(), "bukkit");
  
						 
					
						
							
								
									
										
										
										
											2020-06-26 12:24:35 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            if (!bukkitDataPackFolder.exists()) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                bukkitDataPackFolder.mkdirs();
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            }
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            File mcMeta = new File(bukkitDataPackFolder, "pack.mcmeta");
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            try {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                com.google.common.io.Files.write("{\n"
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        + "    \"pack\": {\n"
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        + "        \"description\": \"Data pack for resources provided by Bukkit plugins\",\n"
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+                        + "        \"pack_format\": " + SharedConstants.getCurrentVersion().getPackVersion() + "\n"
  
						 
					
						
							
								
									
										
										
										
											2020-06-26 12:24:35 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+                        + "    }\n"
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        + "}\n", mcMeta, com.google.common.base.Charsets.UTF_8);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            } catch (java.io.IOException ex) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                throw new RuntimeException("Could not initialize Bukkit datapack", ex);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            }
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            AtomicReference<DataPackConfiguration> config = new AtomicReference<>();
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            AtomicReference<DynamicOps<NBTBase>> ops = new AtomicReference<>();
  
						 
					
						
							
								
									
										
										
										
											2020-06-26 12:24:35 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+            // CraftBukkit end
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             WorldStem worldstem;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -155,6 +185,12 @@
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     return WorldStem.load(worldloader_a, (iresourcemanager, datapackconfiguration1) -> {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         IRegistryCustom.e iregistrycustom_e = IRegistryCustom.builtinCopy();
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         DynamicOps<NBTBase> dynamicops = RegistryOps.createAndLoad(DynamicOpsNBT.INSTANCE, iregistrycustom_e, iresourcemanager);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        // CraftBukkit start
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        config.set(datapackconfiguration1);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        ops.set(dynamicops);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        return Pair.of(null, iregistrycustom_e.freeze());
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        // CraftBukkit end
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        /*
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         SaveData savedata = convertable_conversionsession.getDataTag(dynamicops, datapackconfiguration1, iregistrycustom_e.allElementsLifecycle());
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         if (savedata != null) {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								@@ -177,6 +213,7 @@
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                             return Pair.of(worlddataserver, iregistrycustom_e.freeze());
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                         }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                         */
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                     }, SystemUtils.backgroundExecutor(), executor);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 }).get();
							 
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             } catch (Exception exception) {
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -184,6 +221,7 @@
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 return;
							 
						 
					
						
							
								
									
										
										
										
											2020-08-12 07:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            /*
  
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             IRegistryCustom.Dimension iregistrycustom_dimension = worldstem.registryAccess();
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             dedicatedserversettings.getProperties().getWorldGenSettings(iregistrycustom_dimension);
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -196,21 +234,32 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								             }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata);
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								+            */
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								-                DedicatedServer dedicatedserver1 = new DedicatedServer(thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), services, WorldLoadListenerLogger::new);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), services, WorldLoadListenerLogger::new);
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                /*
  
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                 dedicatedserver1.setSingleplayerProfile(optionset.has(optionspec8) ? new GameProfile((UUID) null, (String) optionset.valueOf(optionspec8)) : null);
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                 dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11));
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                 dedicatedserver1.setDemo(optionset.has(optionspec2));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 dedicatedserver1.setId((String) optionset.valueOf(optionspec12));
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-                boolean flag1 = !optionset.has(optionspec) && !optionset.valuesOf(nonoptionargumentspec).contains("nogui");
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                */
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 if (flag1 && !GraphicsEnvironment.isHeadless()) {
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                     dedicatedserver1.showGui();
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                 }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                if (optionset.has("port")) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                    int port = (Integer) optionset.valueOf("port");
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                    if (port > 0) {
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                        dedicatedserver1.setPort(port);
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                    }
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+                }
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 return dedicatedserver1;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             });
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            /* CraftBukkit start
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             Thread thread = new Thread("Server Shutdown Thread") {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                 public void run() {
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                     dedicatedserver.halt(true);
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -219,6 +268,7 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								             Runtime.getRuntime().addShutdownHook(thread);
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								+            */ // CraftBukkit end
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         } catch (Exception exception1) {
							 
						 
					
						
							
								
									
										
										
										
											2022-03-01 02:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								             Main.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", exception1);
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								         }
							 
						 
					
						
							
								
									
										
										
										
											2022-06-08 02:00:00 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								@@ -226,7 +276,7 @@
  
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								     }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								     public static void forceUpgrade(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, boolean flag, BooleanSupplier booleansupplier, GeneratorSettings generatorsettings) {
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								-        Main.LOGGER.info("Forcing world upgrade!");
  
						 
					
						
							
								
									
										
										
										
											2021-11-22 09:00:00 +11:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								+        Main.LOGGER.info("Forcing world upgrade! {}", convertable_conversionsession.getLevelId()); // CraftBukkit
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								         WorldUpgrader worldupgrader = new WorldUpgrader(convertable_conversionsession, datafixer, generatorsettings, flag);
							 
						 
					
						
							
								
									
										
										
										
											2020-06-25 10:00:00 +10:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								         IChatBaseComponent ichatbasecomponent = null;