parent
3d81d4e5b2
commit
a6004d4f7f
|
@ -2357,7 +2357,7 @@ index df32a8b1df60064c49702dca26d7310b7d27e94b..92faf96e12b443351ea146d4d1deccb0
|
|||
completablefuture = (CompletableFuture) this.futures.get(i);
|
||||
if (completablefuture == null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7ef5caec25 100644
|
||||
index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..e6090343eda328ab612a9345978cf8da353e9566 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -115,7 +115,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -2471,18 +2471,11 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
private void scheduleUnload(long pos, ChunkHolder holder) {
|
||||
CompletableFuture<ChunkAccess> completablefuture = holder.getChunkToSave();
|
||||
Consumer<ChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error
|
||||
@@ -520,13 +567,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -520,7 +567,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
((LevelChunk) ichunkaccess).setLoaded(false);
|
||||
}
|
||||
|
||||
- this.save(ichunkaccess);
|
||||
+ //this.save(ichunkaccess);// Paper - delay
|
||||
if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) {
|
||||
LevelChunk chunk = (LevelChunk) ichunkaccess;
|
||||
|
||||
this.level.unload(chunk);
|
||||
}
|
||||
|
||||
+ // Paper start - async chunk saving
|
||||
+ try {
|
||||
+ this.asyncSave(ichunkaccess);
|
||||
|
@ -2493,11 +2486,10 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
+ this.save(ichunkaccess);
|
||||
+ }
|
||||
+ // Paper end - async chunk saving
|
||||
+
|
||||
this.lightEngine.updateChunkStatus(ichunkaccess.getPos());
|
||||
this.lightEngine.tryScheduleUpdate();
|
||||
this.progressListener.onStatusChange(ichunkaccess.getPos(), (ChunkStatus) null);
|
||||
@@ -581,19 +639,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (this.entitiesInLevel.remove(pos) && ichunkaccess instanceof LevelChunk) {
|
||||
LevelChunk chunk = (LevelChunk) ichunkaccess;
|
||||
|
||||
@@ -581,19 +637,23 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
private CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> scheduleChunkLoad(ChunkPos pos) {
|
||||
|
@ -2514,23 +2506,23 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
+ if (ioThrowable != null) {
|
||||
+ com.destroystokyo.paper.util.SneakyThrow.sneaky(ioThrowable);
|
||||
+ }
|
||||
|
||||
- if (nbttagcompound != null) {try (Timing ignored2 = this.level.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings
|
||||
- boolean flag = nbttagcompound.contains("Level", 10) && nbttagcompound.getCompound("Level").contains("Status", 8);
|
||||
+
|
||||
+ this.getVillagePlace().loadInData(pos, chunkHolder.poiData);
|
||||
+ chunkHolder.tasks.forEach(Runnable::run);
|
||||
+ // Paper end
|
||||
|
||||
- if (nbttagcompound != null) {try (Timing ignored2 = this.level.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings
|
||||
- boolean flag = nbttagcompound.contains("Level", 10) && nbttagcompound.getCompound("Level").contains("Status", 8);
|
||||
+ if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.level.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async
|
||||
|
||||
- if (flag) {
|
||||
- ProtoChunk protochunk = ChunkSerializer.read(this.level, this.structureManager, this.poiManager, pos, nbttagcompound);
|
||||
+ if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.level.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async
|
||||
+
|
||||
+ if (true) {
|
||||
+ ProtoChunk protochunk = chunkHolder.protoChunk;
|
||||
|
||||
this.markPosition(pos, protochunk.getStatus().getChunkType());
|
||||
return Either.left(protochunk);
|
||||
@@ -616,7 +678,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -616,7 +676,32 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
this.markPositionReplaceable(pos);
|
||||
return Either.left(new ProtoChunk(pos, UpgradeData.EMPTY, this.level));
|
||||
|
@ -2564,7 +2556,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
}
|
||||
|
||||
private void markPositionReplaceable(ChunkPos chunkcoordintpair) {
|
||||
@@ -798,6 +885,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -798,6 +883,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public boolean save(ChunkAccess chunk) {
|
||||
|
@ -2572,7 +2564,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
this.poiManager.flush(chunk.getPos());
|
||||
if (!chunk.isUnsaved()) {
|
||||
return false;
|
||||
@@ -809,7 +897,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -809,7 +895,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
ChunkStatus chunkstatus = chunk.getStatus();
|
||||
|
||||
if (chunkstatus.getChunkType() != ChunkStatus.ChunkType.LEVELCHUNK) {
|
||||
|
@ -2581,7 +2573,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
return false;
|
||||
}
|
||||
|
||||
@@ -819,9 +907,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -819,9 +905,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
this.level.getProfiler().incrementCounter("chunkSave");
|
||||
|
@ -2590,9 +2582,9 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
+ try (co.aikar.timings.Timing ignored1 = this.level.timings.chunkSaveDataSerialization.startTiming()) { // Paper
|
||||
+ nbttagcompound = ChunkSerializer.write(this.level, chunk);
|
||||
+ } // Paper
|
||||
+
|
||||
|
||||
- this.write(chunkcoordintpair, nbttagcompound);
|
||||
+
|
||||
+ // Paper start - async chunk io
|
||||
+ com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(this.level, chunkcoordintpair.x, chunkcoordintpair.z,
|
||||
+ null, nbttagcompound, com.destroystokyo.paper.io.PrioritizedTaskQueue.NORMAL_PRIORITY);
|
||||
|
@ -2600,7 +2592,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
this.markPosition(chunkcoordintpair, chunkstatus.getChunkType());
|
||||
return true;
|
||||
} catch (Exception exception) {
|
||||
@@ -830,6 +925,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -830,6 +923,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -2608,7 +2600,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
}
|
||||
|
||||
private boolean isExistingChunkFull(ChunkPos chunkcoordintpair) {
|
||||
@@ -957,6 +1053,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -957,6 +1051,35 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2644,7 +2636,7 @@ index 52bcfcc7443b57b0e57024c0c4e78c5a7260410d..63c7662cc27cf17a4221238b7ed4ed7e
|
|||
@Nullable
|
||||
private CompoundTag readChunk(ChunkPos pos) throws IOException {
|
||||
CompoundTag nbttagcompound = this.read(pos);
|
||||
@@ -1311,6 +1436,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1311,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ index 1e52b8e97dcee512e7d2fbe157152df9e0779bf1..2aa86f35b8960273ad91b21e260bcf91
|
|||
|
||||
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getFutureIfPresentUnchecked(ChunkStatus leastStatus) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 63c7662cc27cf17a4221238b7ed4ed7ef5caec25..851489de98576a5ab5fdc040d459786b6633ff49 100644
|
||||
index e6090343eda328ab612a9345978cf8da353e9566..c687f6b2b97fc32bd01add75d6327f0debbfb290 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -84,6 +84,7 @@ import net.minecraft.world.level.chunk.ProtoChunk;
|
||||
|
@ -43,7 +43,7 @@ index 63c7662cc27cf17a4221238b7ed4ed7ef5caec25..851489de98576a5ab5fdc040d459786b
|
|||
import net.minecraft.world.level.entity.ChunkStatusUpdateListener;
|
||||
import net.minecraft.world.level.levelgen.structure.StructureStart;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
|
||||
@@ -1083,12 +1084,61 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1081,12 +1082,61 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -20,10 +20,10 @@ index 4c177a383b277debe8a7c02a70d029d862e6b048..0c336a794d21d5084b9ea39308379b2f
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 851489de98576a5ab5fdc040d459786b6633ff49..9c7927d8529c6c15216b5714b23a053f9a30a716 100644
|
||||
index c687f6b2b97fc32bd01add75d6327f0debbfb290..579568e90a220ea43ed83df38e6dc3613da850e4 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -678,7 +678,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -676,7 +676,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
this.markPositionReplaceable(pos);
|
||||
|
|
|
@ -83,7 +83,7 @@ index 8190c30346c0fd2d86fb7cbcfc7ce17333e05146..9860f5a0ddff83f1393ee13a96b38c3b
|
|||
private void countAllMobsForSpawning() {
|
||||
countAllMobsForSpawning = getBoolean("count-all-mobs-for-spawning", false);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 9c7927d8529c6c15216b5714b23a053f9a30a716..dba2801b8e3101bd9c6fb87e57db634754f0c8cd 100644
|
||||
index 579568e90a220ea43ed83df38e6dc3613da850e4..aeba7d22f178bf63554343eec84b71020cb9f069 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1,6 +1,7 @@
|
||||
|
@ -112,7 +112,7 @@ index 9c7927d8529c6c15216b5714b23a053f9a30a716..dba2801b8e3101bd9c6fb87e57db6347
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.CompletionException;
|
||||
import java.util.concurrent.CompletionStage;
|
||||
@@ -788,6 +793,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -786,6 +791,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
entity.discard();
|
||||
needsRemoval = true;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ index 9c7927d8529c6c15216b5714b23a053f9a30a716..dba2801b8e3101bd9c6fb87e57db6347
|
|||
return !needsRemoval;
|
||||
}));
|
||||
// CraftBukkit end
|
||||
@@ -837,6 +843,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -835,6 +841,43 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1107,10 +1107,10 @@ index c28879f32b004f36ff746ea2274f91ddd9501e71..7762d8ff94f856d613a6f50311006b69
|
|||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 63ff633834ec00479cc0916d5b2eef42fd6d5e42..4123f529e0bbd97a6a25a08e6e8d129c5e322eb7 100644
|
||||
index 98870a43e9194260072588716742ff7776e92af9..d2328099e5bd807ac63139c89f3aa230fd7a5f7e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1487,7 +1487,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1485,7 +1485,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
public void playerLoadedChunk(ServerPlayer player, Packet<?>[] packets, LevelChunk chunk) {
|
||||
if (packets[0] == null) {
|
||||
|
|
|
@ -145,7 +145,7 @@ index 2aa86f35b8960273ad91b21e260bcf91cf861e08..8fff5580a88fd1643845967eb7bdab26
|
|||
|
||||
public CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> getOrScheduleFuture(ChunkStatus targetStatus, ChunkMap chunkStorage) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8fa932f0f4 100644
|
||||
index d2328099e5bd807ac63139c89f3aa230fd7a5f7e..f820931435d7e17261f9b7c37be036111e7156ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -127,7 +127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -272,7 +272,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
}
|
||||
|
||||
private static double euclideanDistanceSquared(ChunkPos pos, Entity entity) {
|
||||
@@ -906,14 +992,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -904,14 +990,10 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
completablefuture1.thenAcceptAsync((either) -> {
|
||||
either.ifLeft((chunk) -> {
|
||||
this.tickingGenerated.getAndIncrement();
|
||||
|
@ -289,7 +289,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
});
|
||||
return completablefuture1;
|
||||
}
|
||||
@@ -1006,27 +1088,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1004,27 +1086,34 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void setViewDistance(int watchDistance) {
|
||||
|
@ -337,7 +337,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
}
|
||||
}
|
||||
|
||||
@@ -1038,7 +1127,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1036,7 +1125,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
ChunkHolder playerchunk = this.getVisibleChunkIfPresent(pos.toLong());
|
||||
|
||||
if (playerchunk != null) {
|
||||
|
@ -346,7 +346,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
|
||||
if (chunk != null) {
|
||||
this.playerLoadedChunk(player, packets, chunk);
|
||||
@@ -1134,7 +1223,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1132,7 +1221,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end
|
||||
|
||||
@Nullable
|
||||
|
@ -355,7 +355,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
CompoundTag nbttagcompound = this.read(pos);
|
||||
// Paper start - Cache chunk status on disk
|
||||
if (nbttagcompound == null) {
|
||||
@@ -1245,13 +1334,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1243,13 +1332,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
this.removePlayerFromDistanceMaps(player); // Paper - distance maps
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
|
||||
}
|
||||
|
||||
@@ -1259,7 +1342,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1257,7 +1340,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
SectionPos sectionposition = SectionPos.of((Entity) player);
|
||||
|
||||
player.setLastSectionPos(sectionposition);
|
||||
|
@ -379,7 +379,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
return sectionposition;
|
||||
}
|
||||
|
||||
@@ -1314,6 +1397,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1312,6 +1395,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
int k1;
|
||||
int l1;
|
||||
|
||||
|
@ -387,7 +387,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) {
|
||||
k1 = Math.min(i, i1) - this.viewDistance;
|
||||
l1 = Math.min(j, j1) - this.viewDistance;
|
||||
@@ -1352,6 +1436,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1350,6 +1434,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -395,7 +395,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
|
||||
this.updateMaps(player); // Paper - distance maps
|
||||
|
||||
@@ -1359,11 +1444,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1357,11 +1442,46 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
@Override
|
||||
public Stream<ServerPlayer> getPlayers(ChunkPos chunkPos, boolean onlyOnWatchDistanceEdge) {
|
||||
|
@ -447,7 +447,7 @@ index 4123f529e0bbd97a6a25a08e6e8d129c5e322eb7..4af8caff4231fbb8e1997dfa5479cf8f
|
|||
}
|
||||
|
||||
public void addEntity(Entity entity) {
|
||||
@@ -1485,6 +1605,47 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1483,6 +1603,47 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code
|
|||
Also ignores Enderdragon, defaulting it to Mojang's setting
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 4af8caff4231fbb8e1997dfa5479cf8fa932f0f4..c795575e5ae259e78dbd3cb265a2eeeabee6c789 100644
|
||||
index f820931435d7e17261f9b7c37be036111e7156ef..fc0546a2bdc8754c1d9f9ff370127f225bd730c9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1834,6 +1834,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
@@ -1832,6 +1832,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
int j = entity.getType().clientTrackingRange() * 16;
|
||||
|
|
|
@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding
|
|||
Stack will identify any causer of this and warn instead of crashing.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d329d07532d4e4017a4c5cfad7b18795ab8a5186..d3966c1e648df8714b422644703b4d27f0db31ad 100644
|
||||
index d4240b0405520cb292b4cbd4f70ebcd2edc30bbf..acd7318af28022b196d7397601d3511d7f199821 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1509,6 +1509,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1507,6 +1507,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
public void addEntity(Entity entity) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot
|
||||
|
|
|
@ -70,7 +70,7 @@ index 9c88426ab1275ee5fb6e28be8b213533dc4ab859..87c9a5c1b43f6010898d72136b5eb997
|
|||
List<ChunkHolder> allChunks = new ArrayList<>(visibleChunks.values());
|
||||
List<ServerPlayer> players = world.players;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d3966c1e648df8714b422644703b4d27f0db31ad..69b6b510f12a0743aac2100cd7b58687d59e919c 100644
|
||||
index acd7318af28022b196d7397601d3511d7f199821..6947bc74216704d1848387e2b2a8bb57d5105c0f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -112,9 +112,36 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -195,7 +195,7 @@ index d3966c1e648df8714b422644703b4d27f0db31ad..69b6b510f12a0743aac2100cd7b58687
|
|||
ChunkAccess ichunkaccess = (ChunkAccess) playerchunk.getChunkToSave().getNow(null); // CraftBukkit - decompile error
|
||||
|
||||
if (ichunkaccess instanceof ImposterProtoChunk || ichunkaccess instanceof LevelChunk) {
|
||||
@@ -727,7 +798,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -725,7 +796,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
if (!this.modified) {
|
||||
return false;
|
||||
} else {
|
||||
|
@ -217,7 +217,7 @@ index d3966c1e648df8714b422644703b4d27f0db31ad..69b6b510f12a0743aac2100cd7b58687
|
|||
this.modified = false;
|
||||
return true;
|
||||
}
|
||||
@@ -1174,12 +1258,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1172,12 +1256,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
protected Iterable<ChunkHolder> getChunks() {
|
||||
|
|
|
@ -25,7 +25,7 @@ This successfully fixed a reoccurring and highly reproduceable crash
|
|||
for heightmaps.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index dbd256b7be670d30fc68ceaa9e498bf55b405b56..9e17cfcf24d3c4358e650adac45d0ade81119fc2 100644
|
||||
index a84517abccd140cc8a65619f70556072168fc465..dfe7af5568de8d9511f18a6894026f0f1143a0ff 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -195,6 +195,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -36,7 +36,7 @@ index dbd256b7be670d30fc68ceaa9e498bf55b405b56..9e17cfcf24d3c4358e650adac45d0ade
|
|||
// Paper start - distance maps
|
||||
private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<ServerPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>();
|
||||
// Paper start - no-tick view distance
|
||||
@@ -1092,7 +1093,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1090,7 +1091,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return Either.left(chunk);
|
||||
});
|
||||
}, (runnable) -> {
|
||||
|
|
|
@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick
|
|||
delays anymore.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 9e17cfcf24d3c4358e650adac45d0ade81119fc2..4fde1b06f0f10b59386b7f510e2ca494d507397b 100644
|
||||
index dfe7af5568de8d9511f18a6894026f0f1143a0ff..419e928c853d921dccc36471559962caf5006117 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1602,6 +1602,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1600,6 +1600,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ index 11fd6d24ed0612e4df1a0493907178fb9c455d1c..d7023cb0974f6c28a0fb8a0a6e5a6600
|
|||
return initialDistance;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614500edcb6 100644
|
||||
index 187a4542dbdad2708a6ada8a84591788d5d1a125..a345d4bff47b937852ad33be42d5c823dc11c733 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -63,6 +63,7 @@ import net.minecraft.network.protocol.game.ClientboundSetEntityLinkPacket;
|
||||
|
@ -137,7 +137,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
// Paper start - no-tick view distance
|
||||
this.setNoTickViewDistance(this.level.paperConfig.noTickViewDistance);
|
||||
this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets,
|
||||
@@ -1466,17 +1540,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1464,17 +1538,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void move(ServerPlayer player) {
|
||||
|
@ -156,7 +156,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
|
||||
int i = SectionPos.blockToSectionCoord(player.getBlockX());
|
||||
int j = SectionPos.blockToSectionCoord(player.getBlockZ());
|
||||
@@ -1631,7 +1695,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1629,7 +1693,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker
|
||||
this.entityMap.put(entity.getId(), playerchunkmap_entitytracker);
|
||||
|
@ -165,7 +165,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
if (entity instanceof ServerPlayer) {
|
||||
ServerPlayer entityplayer = (ServerPlayer) entity;
|
||||
|
||||
@@ -1675,7 +1739,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1673,7 +1737,37 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
entity.tracker = null; // Paper - We're no longer tracked
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
List<ServerPlayer> list = Lists.newArrayList();
|
||||
List<ServerPlayer> list1 = this.level.players();
|
||||
|
||||
@@ -1784,23 +1878,31 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
@@ -1782,23 +1876,31 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
DebugPackets.sendPoiPacketsForChunk(this.level, chunk.getPos());
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
List<Entity> list1 = Lists.newArrayList();
|
||||
|
@ -247,7 +247,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
|
||||
Iterator iterator;
|
||||
Entity entity1;
|
||||
@@ -1879,6 +1981,42 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
@@ -1877,6 +1979,42 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
this.lastSectionPos = SectionPos.of(entity);
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ index d36b38088adf19273cc5ee55788090da40f4b746..ad85a7c86de78323b8ef31a9d4c06614
|
|||
public boolean equals(Object object) {
|
||||
return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false;
|
||||
}
|
||||
@@ -1964,7 +2102,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
@@ -1962,7 +2100,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
int j = entity.getType().clientTrackingRange() * 16;
|
||||
j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ index 97faf7ece336928f22e518a14653b4fbc672d876..c2401b2ff0547335ddbbeb05c07b7455
|
|||
|
||||
// CraftBukkit start
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index ad85a7c86de78323b8ef31a9d4c06614500edcb6..20cdfe69f7023e4711277839d05e14d6c6bdf0da 100644
|
||||
index a345d4bff47b937852ad33be42d5c823dc11c733..b4b330988bf1a2f0b2ec7da35ee816c1d60f3ab9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -241,6 +241,17 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -148,7 +148,7 @@ index ad85a7c86de78323b8ef31a9d4c06614500edcb6..20cdfe69f7023e4711277839d05e14d6
|
|||
}
|
||||
|
||||
if (holder != null) {
|
||||
@@ -1476,29 +1533,50 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1474,29 +1531,50 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return this.isOutsideOfRange(chunkPos, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker
|
|||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 20cdfe69f7023e4711277839d05e14d6c6bdf0da..ee37c952a91cac91145d3c2418a817633e04f573 100644
|
||||
index b4b330988bf1a2f0b2ec7da35ee816c1d60f3ab9..07a5f69ab2527b038dc4c404dd621a262cad3931 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -2144,9 +2144,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
@@ -2142,9 +2142,14 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||||
public void updatePlayer(ServerPlayer player) {
|
||||
org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot
|
||||
if (player != this.entity) {
|
||||
|
|
|
@ -312,7 +312,7 @@ index c2401b2ff0547335ddbbeb05c07b74552c246fc9..377993f325400a9bc77f5fbc77d9ec50
|
|||
if (chunk != null) {
|
||||
chunkStorage.callbackExecutor.execute(() -> {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index ee37c952a91cac91145d3c2418a817633e04f573..c544529908dd5af63a829f54985eefc236e290db 100644
|
||||
index 07a5f69ab2527b038dc4c404dd621a262cad3931..eced6724126f5c967df95c9c1febef9833b9de26 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -148,6 +148,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -519,7 +519,7 @@ index ee37c952a91cac91145d3c2418a817633e04f573..c544529908dd5af63a829f54985eefc2
|
|||
|
||||
list.add(completablefuture);
|
||||
}
|
||||
@@ -1043,14 +1182,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1041,14 +1180,24 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
};
|
||||
|
||||
CompletableFuture<CompoundTag> chunkSaveFuture = this.level.asyncChunkTaskManager.getChunkSaveFuture(pos.x, pos.z);
|
||||
|
@ -549,7 +549,7 @@ index ee37c952a91cac91145d3c2418a817633e04f573..c544529908dd5af63a829f54985eefc2
|
|||
return ret;
|
||||
// Paper end
|
||||
}
|
||||
@@ -1182,7 +1331,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1180,7 +1329,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
long i = playerchunk.getPos().toLong();
|
||||
|
||||
Objects.requireNonNull(playerchunk);
|
||||
|
|
|
@ -54,7 +54,7 @@ index 377993f325400a9bc77f5fbc77d9ec50f5d76638..c28f693bf7da42570d95ab97ccb0ec2b
|
|||
public ChunkHolder(ChunkPos pos, int level, LevelHeightAccessor world, LevelLightEngine lightingProvider, ChunkHolder.LevelChangeListener levelUpdateListener, ChunkHolder.PlayerProvider playersWatchingChunkProvider) {
|
||||
this.futures = new AtomicReferenceArray(ChunkHolder.CHUNK_STATUSES.size());
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index c544529908dd5af63a829f54985eefc236e290db..4c8e5e3e69c629485b7118dfcc1eb04ac3c5f6c9 100644
|
||||
index eced6724126f5c967df95c9c1febef9833b9de26..2921cc7226bba37af0b3c950038b909806c093a9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -838,7 +838,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
@ -66,7 +66,7 @@ index c544529908dd5af63a829f54985eefc236e290db..4c8e5e3e69c629485b7118dfcc1eb04a
|
|||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1222,6 +1222,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1220,6 +1220,12 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return "chunkGenerate " + requiredStatus.getName();
|
||||
});
|
||||
Executor executor = (runnable) -> {
|
||||
|
|
Loading…
Reference in New Issue