mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-20 14:53:49 -07:00
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -57,6 +57,12 @@
|
||||
@@ -58,6 +58,12 @@
|
||||
import net.minecraft.world.level.storage.WorldInfo;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class Main {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -64,8 +70,9 @@
|
||||
@@ -65,8 +71,9 @@
|
||||
public Main() {}
|
||||
|
||||
@DontObfuscate
|
||||
@@ -24,7 +24,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");
|
||||
@@ -90,9 +97,12 @@
|
||||
@@ -91,9 +98,12 @@
|
||||
optionparser.printHelpOn(System.err);
|
||||
return;
|
||||
}
|
||||
@@ -38,7 +38,7 @@
|
||||
JvmProfiler.INSTANCE.start(Environment.SERVER);
|
||||
}
|
||||
|
||||
@@ -100,13 +110,13 @@
|
||||
@@ -101,13 +111,13 @@
|
||||
DispenserRegistry.validate();
|
||||
SystemUtils.startTimerHackThread();
|
||||
Path path = Paths.get("server.properties");
|
||||
@@ -54,16 +54,13 @@
|
||||
Main.LOGGER.info("Initialized '{}' and '{}'", path.toAbsolutePath(), path1.toAbsolutePath());
|
||||
return;
|
||||
}
|
||||
@@ -116,14 +126,15 @@
|
||||
@@ -117,11 +127,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- File file = new File((String) optionset.valueOf(optionspec9));
|
||||
+ File file = (File) optionset.valueOf("universe"); // CraftBukkit
|
||||
YggdrasilAuthenticationService yggdrasilauthenticationservice = new YggdrasilAuthenticationService(Proxy.NO_PROXY);
|
||||
MinecraftSessionService minecraftsessionservice = yggdrasilauthenticationservice.createMinecraftSessionService();
|
||||
GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository();
|
||||
UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.USERID_CACHE_FILE.getName()));
|
||||
Services services = Services.create(new YggdrasilAuthenticationService(Proxy.NO_PROXY), file);
|
||||
- String s = (String) Optional.ofNullable((String) optionset.valueOf(optionspec10)).orElse(dedicatedserversettings.getProperties().levelName);
|
||||
+ // CraftBukkit start
|
||||
+ String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName);
|
||||
@@ -73,7 +70,7 @@
|
||||
WorldInfo worldinfo = convertable_conversionsession.getSummary();
|
||||
|
||||
if (worldinfo != null) {
|
||||
@@ -138,13 +149,32 @@
|
||||
@@ -136,13 +147,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,46 +104,46 @@
|
||||
|
||||
WorldStem worldstem;
|
||||
|
||||
@@ -158,6 +188,12 @@
|
||||
}, (iresourcemanager, datapackconfiguration) -> {
|
||||
IRegistryCustom.e iregistrycustom_e = IRegistryCustom.builtinCopy();
|
||||
DynamicOps<NBTBase> dynamicops = RegistryOps.createAndLoad(DynamicOpsNBT.INSTANCE, iregistrycustom_e, iresourcemanager);
|
||||
+ // CraftBukkit start
|
||||
+ config.set(datapackconfiguration);
|
||||
+ ops.set(dynamicops);
|
||||
+ return Pair.of(null, iregistrycustom_e.freeze());
|
||||
+ // CraftBukkit end
|
||||
+ /*
|
||||
SaveData savedata = convertable_conversionsession.getDataTag(dynamicops, datapackconfiguration, iregistrycustom_e.allElementsLifecycle());
|
||||
@@ -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) {
|
||||
@@ -180,6 +216,7 @@
|
||||
if (savedata != null) {
|
||||
@@ -177,6 +213,7 @@
|
||||
|
||||
return Pair.of(worlddataserver, iregistrycustom_e.freeze());
|
||||
}
|
||||
+ */
|
||||
}, SystemUtils.backgroundExecutor(), Runnable::run).get();
|
||||
return Pair.of(worlddataserver, iregistrycustom_e.freeze());
|
||||
}
|
||||
+ */
|
||||
}, SystemUtils.backgroundExecutor(), executor);
|
||||
}).get();
|
||||
} catch (Exception exception) {
|
||||
Main.LOGGER.warn("Failed to load datapacks, can't proceed with server load. You can either fix your datapacks or reset to vanilla with --safeMode", exception);
|
||||
@@ -188,6 +225,7 @@
|
||||
@@ -184,6 +221,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
worldstem.updateGlobals();
|
||||
+ /*
|
||||
IRegistryCustom.Dimension iregistrycustom_dimension = worldstem.registryAccess();
|
||||
|
||||
dedicatedserversettings.getProperties().getWorldGenSettings(iregistrycustom_dimension);
|
||||
@@ -200,21 +238,32 @@
|
||||
@@ -196,21 +234,32 @@
|
||||
}
|
||||
|
||||
convertable_conversionsession.saveDataTag(iregistrycustom_dimension, savedata);
|
||||
+ */
|
||||
final DedicatedServer dedicatedserver = (DedicatedServer) MinecraftServer.spin((thread) -> {
|
||||
- DedicatedServer dedicatedserver1 = new DedicatedServer(thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
||||
+ DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, config.get(), ops.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataConverterRegistry.getDataFixer(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new);
|
||||
- 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);
|
||||
|
||||
+ /*
|
||||
dedicatedserver1.setSingleplayerName((String) optionset.valueOf(optionspec8));
|
||||
dedicatedserver1.setSingleplayerProfile(optionset.has(optionspec8) ? new GameProfile((UUID) null, (String) optionset.valueOf(optionspec8)) : null);
|
||||
dedicatedserver1.setPort((Integer) optionset.valueOf(optionspec11));
|
||||
dedicatedserver1.setDemo(optionset.has(optionspec2));
|
||||
dedicatedserver1.setId((String) optionset.valueOf(optionspec12));
|
||||
@@ -171,7 +168,7 @@
|
||||
Thread thread = new Thread("Server Shutdown Thread") {
|
||||
public void run() {
|
||||
dedicatedserver.halt(true);
|
||||
@@ -223,6 +272,7 @@
|
||||
@@ -219,6 +268,7 @@
|
||||
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(Main.LOGGER));
|
||||
Runtime.getRuntime().addShutdownHook(thread);
|
||||
@@ -179,7 +176,7 @@
|
||||
} catch (Exception exception1) {
|
||||
Main.LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", exception1);
|
||||
}
|
||||
@@ -230,7 +280,7 @@
|
||||
@@ -226,7 +276,7 @@
|
||||
}
|
||||
|
||||
public static void forceUpgrade(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, boolean flag, BooleanSupplier booleansupplier, GeneratorSettings generatorsettings) {
|
||||
|
Reference in New Issue
Block a user