0
0
mirror of https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git synced 2024-11-22 06:36:16 +00:00
craftbukkit/nms-patches/net/minecraft/util/worldupdate/WorldUpgrader.patch
2024-10-23 02:15:00 +11:00

33 lines
2.4 KiB
Diff

--- a/net/minecraft/util/worldupdate/WorldUpgrader.java
+++ b/net/minecraft/util/worldupdate/WorldUpgrader.java
@@ -80,7 +80,7 @@
public WorldUpgrader(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, IRegistryCustom iregistrycustom, boolean flag, boolean flag1) {
this.dimensions = iregistrycustom.lookupOrThrow(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;
@@ -197,9 +197,9 @@
if (nbttagcompound != null) {
int i = IChunkLoader.getVersion(nbttagcompound);
ChunkGenerator chunkgenerator = ((WorldDimension) WorldUpgrader.this.dimensions.getValueOrThrow(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)) {
@@ -321,7 +321,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();