3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-16 11:30:06 +01:00
Paper/patches/server/0453-Remove-some-streams-from-structures.patch
Spottedleaf 41647af74c Do not use worldgen executor for api profile completions
We cannot put blocking network I/O onto the worldgen threads,
this will crash the server if it stalls
2022-07-03 14:55:56 -07:00

34 Zeilen
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: JRoy <joshroy126@gmail.com>
Date: Mon, 29 Jun 2020 17:03:06 -0400
Subject: [PATCH] Remove some streams from structures
This showed up a lot in the spark profiler, should have a low-medium performance improvement.
diff --git a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
index 89ec6902abaed56e57d3aa7e355a3db70baa02a0..0548be182bc342cc3855dcf7cc11519fc2805121 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
int j = chunkPos.getMinBlockZ();
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
- structureManager.startsForStructure(chunkPos, (structure) -> {
+ // Paper start - replace for each
+ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(chunkPos, (structure) -> {
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
- }).forEach((structureStart) -> {
+ })) {
TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation();
for(StructurePiece structurePiece : structureStart.getPieces()) {
@@ -63,7 +64,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
}
}
- });
+ } // Paper
return new Beardifier(objectList.iterator(), objectList2.iterator());
}