PaperMC/paper-server/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch
CraftBukkit/Spigot 65bc2541a3 Update to Minecraft 1.20.5
By: md_5 <git@md-5.net>
2024-04-24 01:15:00 +10:00

32 lines
2.4 KiB
Diff

--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
@@ -81,7 +81,7 @@
public WorldUpgrader(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, IRegistryCustom iregistrycustom, boolean flag, boolean flag1) {
this.dimensions = iregistrycustom.registryOrThrow(Registries.LEVEL_STEM);
- this.levels = (Set) this.dimensions.registryKeySet().stream().map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet());
+ this.levels = (Set) java.util.stream.Stream.of(convertable_conversionsession.dimensionType).map(Registries::levelStemToLevel).collect(Collectors.toUnmodifiableSet()); // CraftBukkit
this.eraseCache = flag;
this.dataFixer = datafixer;
this.levelStorage = convertable_conversionsession;
@@ -194,9 +194,9 @@
if (nbttagcompound != null) {
int i = IChunkLoader.getVersion(nbttagcompound);
ChunkGenerator chunkgenerator = ((WorldDimension) WorldUpgrader.this.dimensions.getOrThrow(Registries.levelToLevelStem(resourcekey))).generator();
- NBTTagCompound nbttagcompound1 = ichunkloader.upgradeChunkTag(resourcekey, () -> {
+ NBTTagCompound nbttagcompound1 = ichunkloader.upgradeChunkTag(Registries.levelToLevelStem(resourcekey), () -> { // CraftBukkit
return WorldUpgrader.this.overworldDataStorage;
- }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer());
+ }, nbttagcompound, chunkgenerator.getTypeNameForDataFixer(), chunkcoordintpair, null); // CraftBukkit
ChunkCoordIntPair chunkcoordintpair1 = new ChunkCoordIntPair(nbttagcompound1.getInt("xPos"), nbttagcompound1.getInt("zPos"));
if (!chunkcoordintpair1.equals(chunkcoordintpair)) {
@@ -316,7 +316,7 @@
WorldUpgrader.c<T> worldupgrader_c = (WorldUpgrader.c) iterator.next();
ResourceKey<World> resourcekey = worldupgrader_c.dimensionKey;
ListIterator<WorldUpgrader.e> listiterator = worldupgrader_c.files;
- T t0 = (AutoCloseable) worldupgrader_c.storage;
+ T t0 = (T) worldupgrader_c.storage; // CraftBukkit - decompile error
if (listiterator.hasNext()) {
WorldUpgrader.e worldupgrader_e = (WorldUpgrader.e) listiterator.next();