3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 14:00:11 +01:00
Paper/nms-patches/WorldUpgrader.patch

95 Zeilen
5.5 KiB
Diff

2019-04-23 04:00:00 +02:00
--- a/net/minecraft/server/WorldUpgrader.java
+++ b/net/minecraft/server/WorldUpgrader.java
2020-06-25 09:58:10 +02:00
@@ -25,7 +25,7 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final ThreadFactory b = (new ThreadFactoryBuilder()).setDaemon(true).build();
- private final ImmutableSet<ResourceKey<World>> c;
+ private final ImmutableSet<ResourceKey<DimensionManager>> c; // CraftBukkit
private final boolean d;
private final Convertable.ConversionSession e;
private final Thread f;
@@ -36,12 +36,12 @@
private volatile int k;
private volatile int l;
private volatile int m;
- private final Object2FloatMap<ResourceKey<World>> n = Object2FloatMaps.synchronize(new Object2FloatOpenCustomHashMap(SystemUtils.k()));
+ private final Object2FloatMap<ResourceKey<DimensionManager>> n = Object2FloatMaps.synchronize(new Object2FloatOpenCustomHashMap(SystemUtils.k())); // CraftBukkit
private volatile IChatBaseComponent o = new ChatMessage("optimizeWorld.stage.counting");
private static final Pattern p = Pattern.compile("^r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.mca$");
private final WorldPersistentData q;
- public WorldUpgrader(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, ImmutableSet<ResourceKey<World>> immutableset, boolean flag) {
+ public WorldUpgrader(Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, ImmutableSet<ResourceKey<DimensionManager>> immutableset, boolean flag) { // CraftBukkit
this.c = immutableset;
this.d = flag;
this.g = datafixer;
@@ -69,12 +69,12 @@
private void i() {
this.k = 0;
- Builder<ResourceKey<World>, ListIterator<ChunkCoordIntPair>> builder = ImmutableMap.builder();
+ Builder<ResourceKey<DimensionManager>, ListIterator<ChunkCoordIntPair>> builder = ImmutableMap.builder(); // CraftBukkit
List list;
for (UnmodifiableIterator unmodifiableiterator = this.c.iterator(); unmodifiableiterator.hasNext(); this.k += list.size()) {
- ResourceKey<World> resourcekey = (ResourceKey) unmodifiableiterator.next();
+ ResourceKey<DimensionManager> resourcekey = (ResourceKey) unmodifiableiterator.next(); // CraftBukkit
list = this.b(resourcekey);
builder.put(resourcekey, list.listIterator());
@@ -84,18 +84,18 @@
this.i = true;
} else {
float f = (float) this.k;
- ImmutableMap<ResourceKey<World>, ListIterator<ChunkCoordIntPair>> immutablemap = builder.build();
- Builder<ResourceKey<World>, IChunkLoader> builder1 = ImmutableMap.builder();
+ ImmutableMap<ResourceKey<DimensionManager>, ListIterator<ChunkCoordIntPair>> immutablemap = builder.build(); // CraftBukkit
+ Builder<ResourceKey<DimensionManager>, IChunkLoader> builder1 = ImmutableMap.builder(); // CraftBukkit
UnmodifiableIterator unmodifiableiterator1 = this.c.iterator();
while (unmodifiableiterator1.hasNext()) {
- ResourceKey<World> resourcekey1 = (ResourceKey) unmodifiableiterator1.next();
- File file = this.e.a(resourcekey1);
+ ResourceKey<DimensionManager> resourcekey1 = (ResourceKey) unmodifiableiterator1.next(); // CraftBukkit
+ File file = this.e.a(null); // CraftBukkit
builder1.put(resourcekey1, new IChunkLoader(new File(file, "region"), this.g, true));
}
- ImmutableMap<ResourceKey<World>, IChunkLoader> immutablemap1 = builder1.build();
+ ImmutableMap<ResourceKey<DimensionManager>, IChunkLoader> immutablemap1 = builder1.build(); // CraftBukkit
long i = SystemUtils.getMonotonicMillis();
this.o = new ChatMessage("optimizeWorld.stage.upgrading");
@@ -107,7 +107,7 @@
float f2;
for (UnmodifiableIterator unmodifiableiterator2 = this.c.iterator(); unmodifiableiterator2.hasNext(); f1 += f2) {
- ResourceKey<World> resourcekey2 = (ResourceKey) unmodifiableiterator2.next();
+ ResourceKey<DimensionManager> resourcekey2 = (ResourceKey) unmodifiableiterator2.next(); // CraftBukkit
ListIterator<ChunkCoordIntPair> listiterator = (ListIterator) immutablemap.get(resourcekey2);
IChunkLoader ichunkloader = (IChunkLoader) immutablemap1.get(resourcekey2);
2020-06-25 02:00:00 +02:00
@@ -122,7 +122,7 @@
2019-04-23 04:00:00 +02:00
int j = IChunkLoader.a(nbttagcompound);
2020-06-25 02:00:00 +02:00
NBTTagCompound nbttagcompound1 = ichunkloader.getChunkData(resourcekey2, () -> {
2019-04-23 04:00:00 +02:00
return this.q;
- }, nbttagcompound);
+ }, nbttagcompound, chunkcoordintpair, null); // CraftBukkit
2019-12-10 23:00:00 +01:00
NBTTagCompound nbttagcompound2 = nbttagcompound1.getCompound("Level");
ChunkCoordIntPair chunkcoordintpair1 = new ChunkCoordIntPair(nbttagcompound2.getInt("xPos"), nbttagcompound2.getInt("zPos"));
2019-04-23 04:00:00 +02:00
2020-06-25 09:58:10 +02:00
@@ -195,8 +195,8 @@
}
}
- private List<ChunkCoordIntPair> b(ResourceKey<World> resourcekey) {
- File file = this.e.a(resourcekey);
+ private List<ChunkCoordIntPair> b(ResourceKey<DimensionManager> resourcekey) { // CraftBukkit
+ File file = this.e.a(null); // CraftBukkit
File file1 = new File(file, "region");
File[] afile = file1.listFiles((file2, s) -> {
return s.endsWith(".mca");