Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@
LevelStorageSource levelStorageSource = LevelStorageSource.createDefault(universePath.toPath());
LevelStorageSource.LevelStorageAccess access = levelStorageSource.validateAndCreateAccess(levelName);
Dynamic<?> levelDataTag;
@@ -150,12 +_,36 @@
@@ -149,13 +_,38 @@
} else {
levelDataTag = null;
}
+ io.papermc.paper.world.migration.WorldFolderMigration.didInitialLoad = true; // Paper

- boolean safeModeEnabled = options.has(safeMode);
+ boolean safeModeEnabled = options.has("safeMode"); // CraftBukkit
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/net/minecraft/util/filefix/FileFixerUpper.java
+++ b/net/minecraft/util/filefix/FileFixerUpper.java
@@ -82,6 +_,7 @@
) throws FileFixException {
int loadedVersion = NbtUtils.getDataVersion(levelDataTag);
if (this.requiresFileFixing(loadedVersion)) {
+ if (!io.papermc.paper.world.migration.WorldFolderMigration.didInitialLoad) io.papermc.paper.world.migration.WorldFolderMigration.warnAndDelayStartupMigration(); // Paper
Comment thread
jpenilla marked this conversation as resolved.
LOGGER.info("Starting upgrade for world \"{}\"", worldAccess.getLevelId());
Path worldFolder = worldAccess.getLevelDirectory().path();
Path fileFixDirectory = worldFolder.resolve("filefix");
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
public final class WorldFolderMigration {
private static final Logger LOGGER = LogUtils.getClassLogger();
private static final boolean DISABLE_MIGRATION_DELAY = Boolean.getBoolean("paper.disableMigrationDelay");
public static boolean didInitialLoad;
private static boolean startupMigrationWarningShown;
Comment thread
jpenilla marked this conversation as resolved.

private WorldFolderMigration() {
Expand Down Expand Up @@ -60,7 +61,7 @@ public static void migrateApiWorld(
LegacyCraftBukkitWorldMigration.migrateApiWorld(new WorldMigrationContext(rootAccess, registryAccess, worldName, stemKey, dimensionKey));
}

private static synchronized void warnAndDelayStartupMigration() throws IOException {
public static synchronized void warnAndDelayStartupMigration() {
if (startupMigrationWarningShown) {
return;
}
Expand All @@ -77,7 +78,7 @@ private static synchronized void warnAndDelayStartupMigration() throws IOExcepti
Thread.sleep(30_000L);
} catch (final InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IOException("Interrupted while waiting before startup world migration", ex);
throw new RuntimeException("Interrupted while waiting before startup world migration", ex);
}
Comment thread
jpenilla marked this conversation as resolved.
}
LOGGER.info("Continuing with startup world migration.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public boolean isDifficultyLocked() {

private PrimaryLevelData rootDataOrThrow() {
if (this.rootData == null) {
throw new IllegalStateException("PaperWorldLevelOverrides not attached");
throw new IllegalStateException(this.getClass().getName() + " not attached");
}
return this.rootData;
}
Expand Down
Loading