blob: 0f1c833772dbd86458ff010a6088088d2b6c4e83 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
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 81b3f09e2da2363184f57bac08651185c8685b1a..6a2db2294d8692c070243d5e4f8773daa30bead6 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
@@ -16,6 +16,7 @@ import net.minecraft.world.level.levelgen.feature.structures.StructureTemplatePo
import net.minecraft.world.level.levelgen.structure.BoundingBox;
import net.minecraft.world.level.levelgen.structure.PoolElementStructurePiece;
import net.minecraft.world.level.levelgen.structure.StructurePiece;
+import net.minecraft.world.level.levelgen.structure.StructureStart;
public class Beardifier implements NoiseChunk.NoiseFiller {
public static final int BEARD_KERNEL_RADIUS = 12;
@@ -43,7 +44,7 @@ public class Beardifier implements NoiseChunk.NoiseFiller {
this.rigids = new ObjectArrayList<>(10);
for(StructureFeature<?> structureFeature : StructureFeature.NOISE_AFFECTING_FEATURES) {
- structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature).forEach((start) -> {
+ for (StructureStart<?> start : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature)) { // Paper - remove streams
for(StructurePiece structurePiece : start.getPieces()) {
if (structurePiece.isCloseToChunk(chunkPos, 12)) {
if (structurePiece instanceof PoolElementStructurePiece) {
@@ -66,7 +67,7 @@ public class Beardifier implements NoiseChunk.NoiseFiller {
}
}
- });
+ } // Paper
}
this.pieceIterator = this.rigids.iterator();
|