mirror of
https://github.com/PaperMC/Paper.git
synced 2024-08-30 16:49:42 +02:00
38 lines
2.1 KiB
Diff
38 lines
2.1 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 1de44cc8d3e030421ad50a732bfe569f569655f0..98c4ddb261b6a17f6b8fc269c98add92688cae96 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((structureStart) -> {
|
|
+ for (StructureStart<?> structureStart : structureAccessor.startsForFeature(SectionPos.bottomOf(chunk), structureFeature)) { // Paper - remove streams
|
|
for(StructurePiece structurePiece : structureStart.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();
|