Reduce allocation rate for checkBlock

Use ObjectOpenHashSet instead of HashSet
Remove unnecessary chunkToSave modification
This commit is contained in:
Ilari Suhonen
2022-09-29 09:04:52 -07:00
parent 3acabf7aa9
commit 87abd1cde2
2 changed files with 6 additions and 31 deletions

View File

@@ -15713,17 +15713,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.theLightEngine.relightChunks(chunks, (ChunkPos chunkPos) -> {
chunkLightCallback.accept(chunkPos);
((java.util.concurrent.Executor)((ServerLevel)this.theLightEngine.getWorld()).getChunkSource().mainThreadProcessor).execute(() -> {
@@ -0,0 +0,0 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl
for (int dz = -1; dz <= 1; ++dz) {
ChunkHolder neighbour = world.getChunkSource().chunkMap.getUpdatingChunkIfPresent(CoordinateUtils.getChunkKey(dx + chunkX, dz + chunkZ));
if (neighbour != null) {
- neighbour.chunkToSave = neighbour.chunkToSave.thenCombine(updateFuture, (final ChunkAccess curr, final Void ignore) -> {
- return curr;
- });
+ // Paper - rewrite chunk system - not needed, light ticket will keep these chunks loaded
}
}
}
@@ -0,0 +0,0 @@ public class ThreadedLevelLightEngine extends LevelLightEngine implements AutoCl
}