Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/patches/server/0423-Remove-some-streams-from-structures.patch

49 Zeilen
2.6 KiB
Diff

2022-06-08 07:46:52 +02: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
2023-09-22 19:31:02 +02:00
index 46938d6e73666a3a1c393423f58027d593bd8d62..1efa3d0df38d8a1385fdd49ec20975c63a569eaf 100644
2022-06-08 07:46:52 +02: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-28 00:20:14 +02:00
@@ -36,9 +36,10 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
2022-07-27 22:46:05 +02:00
int j = pos.getMinBlockZ();
2022-06-08 07:46:52 +02:00
ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
2022-07-27 22:46:05 +02:00
- world.startsForStructure(pos, (structure) -> {
2022-06-08 07:46:52 +02:00
+ // Paper start - replace for each
2022-07-28 00:20:14 +02:00
+ for (net.minecraft.world.level.levelgen.structure.StructureStart start : world.startsForStructure(pos, (structure) -> {
2022-06-08 07:46:52 +02:00
return structure.terrainAdaptation() != TerrainAdjustment.NONE;
2022-07-27 22:46:05 +02:00
- }).forEach((start) -> {
+ })) { // Paper end
2022-07-28 00:20:14 +02:00
TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation();
2022-06-08 07:46:52 +02:00
2022-07-27 22:46:05 +02:00
for(StructurePiece structurePiece : start.getPieces()) {
2022-07-28 00:20:14 +02:00
@@ -51,9 +52,11 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
}
for(JigsawJunction jigsawJunction : poolElementStructurePiece.getJunctions()) {
- int i = jigsawJunction.getSourceX();
- int j = jigsawJunction.getSourceZ();
- if (i > i - 12 && j > j - 12 && i < i + 15 + 12 && j < j + 15 + 12) {
+ // Paper start - decompile fix
+ int i2 = jigsawJunction.getSourceX();
+ int j2 = jigsawJunction.getSourceZ();
+ if (i2 > i - 12 && j2 > j - 12 && i2 < i + 15 + 12 && j2 < j + 15 + 12) {
+ // Paper end
objectList2.add(jigsawJunction);
}
}
@@ -63,7 +66,7 @@ public class Beardifier implements DensityFunctions.BeardifierOrMarker {
2022-06-08 07:46:52 +02:00
}
}
- });
+ } // Paper
return new Beardifier(objectList.iterator(), objectList2.iterator());
}