2022-06-08 05:46:52 +00:00
|
|
|
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
|
2022-07-27 20:46:05 +00:00
|
|
|
index 24f58441ae7b43a62d74aa55e9808c1c65f466e4..8ec886a10fc901a964f626a350b39c3fda0e59d9 100644
|
2022-06-08 05:46:52 +00:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/Beardifier.java
|
2022-07-27 20:46:05 +00:00
|
|
|
@@ -36,10 +36,11 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
|
|
|
int j = pos.getMinBlockZ();
|
2022-06-08 05:46:52 +00:00
|
|
|
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
|
|
|
|
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
|
2022-07-27 20:46:05 +00:00
|
|
|
- world.startsForStructure(pos, (structure) -> {
|
2022-06-08 05:46:52 +00:00
|
|
|
+ // Paper start - replace for each
|
2022-07-27 20:46:05 +00:00
|
|
|
+ for (net.minecraft.world.level.levelgen.structure.StructureStart structureStart : structureManager.startsForStructure(pos, (structure) -> {
|
2022-06-08 05:46:52 +00:00
|
|
|
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
|
2022-07-27 20:46:05 +00:00
|
|
|
- }).forEach((start) -> {
|
|
|
|
- TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation();
|
|
|
|
+ })) { // Paper end
|
|
|
|
+ TerrainAdjustment terrainAdjustment = structureStart.getStructure().terrainAdaptation();
|
2022-06-08 05:46:52 +00:00
|
|
|
|
2022-07-27 20:46:05 +00:00
|
|
|
for(StructurePiece structurePiece : start.getPieces()) {
|
|
|
|
if (structurePiece.isCloseToChunk(pos, 12)) {
|
2022-06-08 05:46:52 +00:00
|
|
|
@@ -63,7 +64,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
- });
|
|
|
|
+ } // Paper
|
|
|
|
return new Beardifier(objectList.iterator(), objectList2.iterator());
|
|
|
|
}
|
|
|
|
|