mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-10 00:52:22 -07:00
Update to Minecraft 1.16.1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/server/PlayerChunkMap.java
|
||||
+++ b/net/minecraft/server/PlayerChunkMap.java
|
||||
@@ -43,6 +43,7 @@
|
||||
@@ -44,6 +44,7 @@
|
||||
import org.apache.commons.lang3.mutable.MutableBoolean;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||||
|
||||
@@ -73,6 +74,31 @@
|
||||
private final Queue<Runnable> z;
|
||||
@@ -75,6 +76,31 @@
|
||||
private final Queue<Runnable> A;
|
||||
private int viewDistance;
|
||||
|
||||
+ // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback()
|
||||
@@ -37,10 +37,10 @@
|
||||
+ };
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public PlayerChunkMap(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator<?> chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i) {
|
||||
super(new File(worldserver.getWorldProvider().getDimensionManager().a(file), "region"), datafixer);
|
||||
public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) {
|
||||
super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag);
|
||||
this.visibleChunks = this.updatingChunks.clone();
|
||||
@@ -192,9 +218,12 @@
|
||||
@@ -195,9 +221,12 @@
|
||||
|
||||
return completablefuture1.thenApply((list1) -> {
|
||||
List<IChunkAccess> list2 = Lists.newArrayList();
|
||||
@@ -55,7 +55,7 @@
|
||||
final Either<IChunkAccess, PlayerChunk.Failure> either = (Either) iterator.next();
|
||||
Optional<IChunkAccess> optional = either.left();
|
||||
|
||||
@@ -297,7 +326,7 @@
|
||||
@@ -300,7 +329,7 @@
|
||||
PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName());
|
||||
} else {
|
||||
this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> {
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) {
|
||||
this.saveChunk(ichunkaccess);
|
||||
@@ -308,7 +337,6 @@
|
||||
@@ -311,7 +340,6 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
protected void unloadChunks(BooleanSupplier booleansupplier) {
|
||||
GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler();
|
||||
|
||||
@@ -347,7 +375,7 @@
|
||||
@@ -350,7 +378,7 @@
|
||||
|
||||
private void a(long i, PlayerChunk playerchunk) {
|
||||
CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave();
|
||||
@@ -81,16 +81,7 @@
|
||||
CompletableFuture<IChunkAccess> completablefuture1 = playerchunk.getChunkSave();
|
||||
|
||||
if (completablefuture1 != completablefuture) {
|
||||
@@ -500,7 +528,7 @@
|
||||
return CompletableFuture.completedFuture(Either.right(playerchunk_failure));
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxWorldGen.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxWorldGen.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -558,8 +586,15 @@
|
||||
@@ -572,8 +600,15 @@
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
@@ -107,43 +98,7 @@
|
||||
if (list == null) {
|
||||
list = Lists.newArrayList(new Entity[]{entity});
|
||||
} else {
|
||||
@@ -581,7 +616,7 @@
|
||||
long i = playerchunk.i().pair();
|
||||
|
||||
playerchunk.getClass();
|
||||
- mailbox.a((Object) ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel));
|
||||
+ mailbox.a(ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -598,7 +633,7 @@
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxMain.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
});
|
||||
|
||||
completablefuture1.thenAcceptAsync((either) -> {
|
||||
@@ -612,7 +647,7 @@
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxMain.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
});
|
||||
return completablefuture1;
|
||||
}
|
||||
@@ -626,7 +661,7 @@
|
||||
return chunk;
|
||||
});
|
||||
}, (runnable) -> {
|
||||
- this.mailboxMain.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable));
|
||||
+ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -751,7 +786,8 @@
|
||||
@@ -784,7 +819,8 @@
|
||||
return ichunkaccess instanceof Chunk ? Optional.of((Chunk) ichunkaccess) : Optional.empty();
|
||||
});
|
||||
|
||||
@@ -153,7 +108,7 @@
|
||||
return Stream.of(chunk.getEntitySlices()).mapToInt(EntitySlice::size).sum();
|
||||
}).orElse(0), optional1.map((chunk) -> {
|
||||
return chunk.getTileEntities().size();
|
||||
@@ -762,7 +798,7 @@
|
||||
@@ -795,7 +831,7 @@
|
||||
|
||||
private static String a(CompletableFuture<Either<Chunk, PlayerChunk.Failure>> completablefuture) {
|
||||
try {
|
||||
@@ -162,16 +117,16 @@
|
||||
|
||||
return either != null ? (String) either.map((chunk) -> {
|
||||
return "done";
|
||||
@@ -780,7 +816,7 @@
|
||||
@@ -813,7 +849,7 @@
|
||||
private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException {
|
||||
NBTTagCompound nbttagcompound = this.read(chunkcoordintpair);
|
||||
|
||||
- return nbttagcompound == null ? null : this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.l, nbttagcompound);
|
||||
+ return nbttagcompound == null ? null : this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.l, nbttagcompound, chunkcoordintpair, world); // CraftBukkit
|
||||
- return nbttagcompound == null ? null : this.getChunkData(this.world.getDimensionKey(), this.l, nbttagcompound);
|
||||
+ return nbttagcompound == null ? null : this.getChunkData(this.world.getDimensionKey(), this.l, nbttagcompound, chunkcoordintpair, world); // CraftBukkit
|
||||
}
|
||||
|
||||
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
|
||||
@@ -1114,7 +1150,7 @@
|
||||
@@ -1145,7 +1181,7 @@
|
||||
public final Set<EntityPlayer> trackedPlayers = Sets.newHashSet();
|
||||
|
||||
public EntityTracker(Entity entity, int i, int j, boolean flag) {
|
||||
@@ -180,7 +135,7 @@
|
||||
this.tracker = entity;
|
||||
this.trackingDistance = i;
|
||||
this.e = SectionPosition.a(entity);
|
||||
@@ -1167,7 +1203,7 @@
|
||||
@@ -1198,7 +1234,7 @@
|
||||
|
||||
public void updatePlayer(EntityPlayer entityplayer) {
|
||||
if (entityplayer != this.tracker) {
|
||||
@@ -189,7 +144,7 @@
|
||||
int i = Math.min(this.b(), (PlayerChunkMap.this.viewDistance - 1) * 16);
|
||||
boolean flag = vec3d.x >= (double) (-i) && vec3d.x <= (double) i && vec3d.z >= (double) (-i) && vec3d.z <= (double) i && this.tracker.a(entityplayer);
|
||||
|
||||
@@ -1183,6 +1219,17 @@
|
||||
@@ -1214,6 +1250,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user