diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch new file mode 100644 index 0000000000..1717a9783f --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/util/worldupdate/WorldUpgrader.java.patch @@ -0,0 +1,40 @@ +--- a/net/minecraft/util/worldupdate/WorldUpgrader.java ++++ b/net/minecraft/util/worldupdate/WorldUpgrader.java +@@ -62,7 +66,7 @@ + + public WorldUpgrader(LevelStorageSource.LevelStorageAccess levelStoarge, DataFixer dataFixer, Registry<LevelStem> dimensions, boolean eraseCache) { + this.dimensions = dimensions; +- this.levels = dimensions.registryKeySet().stream().map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); ++ 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; +@@ -123,16 +140,18 @@ + boolean flag1 = false; + + try { +- CompoundTag compoundTag = chunkStorage.read(chunkPos).join().orElse(null); +- if (compoundTag != null) { +- int version = ChunkStorage.getVersion(compoundTag); +- ChunkGenerator chunkGenerator = this.dimensions.getOrThrow(Registries.levelToLevelStem(resourceKey2)).generator(); +- CompoundTag compoundTag1 = chunkStorage.upgradeChunkTag( +- resourceKey2, () -> this.overworldDataStorage, compoundTag, chunkGenerator.getTypeNameForDataFixer() +- ); +- ChunkPos chunkPos1 = new ChunkPos(compoundTag1.getInt("xPos"), compoundTag1.getInt("zPos")); +- if (!chunkPos1.equals(chunkPos)) { +- LOGGER.warn("Chunk {} has invalid position {}", chunkPos, chunkPos1); ++ CompoundTag nbttagcompound = (CompoundTag) ((Optional) ichunkloader.read(chunkcoordintpair).join()).orElse((Object) null); ++ ++ if (nbttagcompound != null) { ++ int j = ChunkStorage.getVersion(nbttagcompound); ++ ChunkGenerator chunkgenerator = ((LevelStem) this.dimensions.getOrThrow(Registries.levelToLevelStem(resourcekey2))).generator(); ++ CompoundTag nbttagcompound1 = ichunkloader.upgradeChunkTag(Registries.levelToLevelStem(resourcekey2), () -> { // CraftBukkit ++ return this.overworldDataStorage; ++ }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer(), chunkcoordintpair, null); // CraftBukkit ++ ChunkPos chunkcoordintpair1 = new ChunkPos(nbttagcompound1.getInt("xPos"), nbttagcompound1.getInt("zPos")); ++ ++ if (!chunkcoordintpair1.equals(chunkcoordintpair)) { ++ WorldUpgrader.LOGGER.warn("Chunk {} has invalid position {}", chunkcoordintpair, chunkcoordintpair1); + } + + boolean flag2 = version < SharedConstants.getCurrentVersion().getDataVersion().getVersion(); |