mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 14:12:20 -07:00
1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
This commit is contained in:
committed by
Nassim Jahnke
parent
39203a65e0
commit
a24f9b204c
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/Main.java
|
||||
+++ b/net/minecraft/server/Main.java
|
||||
@@ -67,8 +_,10 @@
|
||||
@@ -68,8 +_,10 @@
|
||||
reason = "System.out needed before bootstrap"
|
||||
)
|
||||
@DontObfuscate
|
||||
@@ -12,7 +12,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");
|
||||
@@ -93,41 +_,94 @@
|
||||
@@ -94,41 +_,94 @@
|
||||
optionParser.printHelpOn(System.err);
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@
|
||||
Dynamic<?> dataTag;
|
||||
if (levelStorageAccess.hasWorldData()) {
|
||||
LevelSummary summary;
|
||||
@@ -169,12 +_,33 @@
|
||||
@@ -170,12 +_,33 @@
|
||||
}
|
||||
|
||||
Dynamic<?> dynamic = dataTag;
|
||||
@@ -141,7 +141,7 @@
|
||||
+ "pack_format": %d
|
||||
+ }
|
||||
+ }
|
||||
+ """.formatted(SharedConstants.getCurrentVersion().getPackVersion(net.minecraft.server.packs.PackType.SERVER_DATA))
|
||||
+ """.formatted(SharedConstants.getCurrentVersion().packVersion(net.minecraft.server.packs.PackType.SERVER_DATA))
|
||||
+ );
|
||||
+ } catch (java.io.IOException ex) {
|
||||
+ throw new RuntimeException("Could not initialize Bukkit datapack", ex);
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
WorldStem worldStem;
|
||||
try {
|
||||
@@ -183,6 +_,7 @@
|
||||
@@ -184,6 +_,7 @@
|
||||
executor -> WorldLoader.load(
|
||||
initConfig,
|
||||
context -> {
|
||||
@@ -159,7 +159,7 @@
|
||||
Registry<LevelStem> registry = context.datapackDimensions().lookupOrThrow(Registries.LEVEL_STEM);
|
||||
if (dynamic != null) {
|
||||
LevelDataAndDimensions levelDataAndDimensions = LevelStorageSource.getLevelDataAndDimensions(
|
||||
@@ -196,7 +_,7 @@
|
||||
@@ -197,7 +_,7 @@
|
||||
LevelSettings levelSettings;
|
||||
WorldOptions worldOptions;
|
||||
WorldDimensions worldDimensions;
|
||||
@@ -168,7 +168,7 @@
|
||||
levelSettings = MinecraftServer.DEMO_SETTINGS;
|
||||
worldOptions = WorldOptions.DEMO_OPTIONS;
|
||||
worldDimensions = WorldPresets.createNormalWorldDimensions(context.datapackWorldgen());
|
||||
@@ -211,7 +_,7 @@
|
||||
@@ -212,7 +_,7 @@
|
||||
new GameRules(context.dataConfiguration().enabledFeatures()),
|
||||
context.dataConfiguration()
|
||||
);
|
||||
@@ -177,7 +177,7 @@
|
||||
worldDimensions = properties.createDimensions(context.datapackWorldgen());
|
||||
}
|
||||
|
||||
@@ -237,6 +_,7 @@
|
||||
@@ -238,6 +_,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
RegistryAccess.Frozen frozen = worldStem.registries().compositeAccess();
|
||||
WorldData worldData = worldStem.worldData();
|
||||
boolean hasOptionSpec1 = optionSet.has(optionSpec6);
|
||||
@@ -245,9 +_,13 @@
|
||||
@@ -246,9 +_,13 @@
|
||||
}
|
||||
|
||||
levelStorageAccess.saveDataTag(frozen, worldData);
|
||||
@@ -199,7 +199,7 @@
|
||||
thread1,
|
||||
levelStorageAccess,
|
||||
packRepository,
|
||||
@@ -257,17 +_,34 @@
|
||||
@@ -258,18 +_,36 @@
|
||||
services,
|
||||
LoggerChunkProgressListener::createFromGameruleRadius
|
||||
);
|
||||
@@ -221,14 +221,16 @@
|
||||
if (flag && !GraphicsEnvironment.isHeadless()) {
|
||||
dedicatedServer1.showGui();
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ if (optionSet.has("port")) {
|
||||
+ int port = (Integer) optionSet.valueOf("port");
|
||||
+ if (port > 0) {
|
||||
+ dedicatedServer1.setPort(port);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Paper end
|
||||
|
||||
GameTestTicker.SINGLETON.startTicking();
|
||||
return dedicatedServer1;
|
||||
}
|
||||
);
|
||||
@@ -236,7 +238,7 @@
|
||||
Thread thread = new Thread("Server Shutdown Thread") {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -276,6 +_,7 @@
|
||||
@@ -278,6 +_,7 @@
|
||||
};
|
||||
thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER));
|
||||
Runtime.getRuntime().addShutdownHook(thread);
|
||||
@@ -244,7 +246,7 @@
|
||||
} catch (Exception var42) {
|
||||
LOGGER.error(LogUtils.FATAL_MARKER, "Failed to start the minecraft server", (Throwable)var42);
|
||||
}
|
||||
@@ -317,7 +_,7 @@
|
||||
@@ -319,7 +_,7 @@
|
||||
RegistryAccess registryAccess,
|
||||
boolean recreateRegionFiles
|
||||
) {
|
||||
|
Reference in New Issue
Block a user