diff options
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch')
-rw-r--r-- | patch-remap/mache-spigotflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch new file mode 100644 index 0000000000..14d66bba93 --- /dev/null +++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch @@ -0,0 +1,37 @@ +--- a/net/minecraft/util/worldupdate/WorldUpgrader.java ++++ b/net/minecraft/util/worldupdate/WorldUpgrader.java +@@ -64,13 +64,13 @@ + private static final Pattern REGEX = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$"); + private final DimensionDataStorage overworldDataStorage; + +- public WorldUpgrader(LevelStorageSource.LevelStorageAccess levelstoragesource_levelstorageaccess, DataFixer datafixer, Registry<LevelStem> registry, boolean flag) { +- this.dimensions = registry; +- this.levels = (Set) registry.registryKeySet().stream().map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); +- this.eraseCache = flag; +- this.dataFixer = datafixer; +- this.levelStorage = levelstoragesource_levelstorageaccess; +- this.overworldDataStorage = new DimensionDataStorage(this.levelStorage.getDimensionPath(Level.OVERWORLD).resolve("data").toFile(), datafixer); ++ public WorldUpgrader(LevelStorageSource.LevelStorageAccess levelStoarge, DataFixer dataFixer, Registry<LevelStem> dimensions, boolean eraseCache) { ++ this.dimensions = dimensions; ++ this.levels = (Set) java.util.stream.Stream.of(levelStoarge.dimensionType).map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); // CraftBukkit ++ this.eraseCache = eraseCache; ++ this.dataFixer = dataFixer; ++ this.levelStorage = levelStoarge; ++ this.overworldDataStorage = new DimensionDataStorage(this.levelStorage.getDimensionPath(Level.OVERWORLD).resolve("data").toFile(), dataFixer); + this.thread = WorldUpgrader.THREAD_FACTORY.newThread(this::work); + this.thread.setUncaughtExceptionHandler((thread, throwable) -> { + WorldUpgrader.LOGGER.error("Error upgrading world", throwable); +@@ -145,10 +145,10 @@ + if (compoundtag != null) { + int j = ChunkStorage.getVersion(compoundtag); + ChunkGenerator chunkgenerator = ((LevelStem) this.dimensions.getOrThrow(Registries.levelToLevelStem(resourcekey2))).generator(); +- CompoundTag compoundtag1 = chunkstorage.upgradeChunkTag(resourcekey2, () -> { ++ CompoundTag nbttagcompound1 = ichunkloader.upgradeChunkTag(Registries.levelToLevelStem(resourcekey2), () -> { // CraftBukkit + return this.overworldDataStorage; +- }, compoundtag, chunkgenerator.getTypeNameForDataFixer()); +- ChunkPos chunkpos1 = new ChunkPos(compoundtag1.getInt("xPos"), compoundtag1.getInt("zPos")); ++ }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer(), chunkcoordintpair, null); // CraftBukkit ++ ChunkPos chunkcoordintpair1 = new ChunkPos(nbttagcompound1.getInt("xPos"), nbttagcompound1.getInt("zPos")); + + if (!chunkpos1.equals(chunkpos)) { + WorldUpgrader.LOGGER.warn("Chunk {} has invalid position {}", chunkpos, chunkpos1); |