aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0423-Remove-some-streams-from-structures.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-12-11 22:02:06 -0800
committerGitHub <[email protected]>2023-12-11 22:02:06 -0800
commit7c2dc4b3429f16943300da0eb06100e910ad832e (patch)
tree395f09771ea04483c92771e7743ff0a2f7e0d6be /patches/server/0423-Remove-some-streams-from-structures.patch
parent82f9280ae46c16cd18cf21f4b0d7802328a36020 (diff)
downloadPaper-7c2dc4b3429f16943300da0eb06100e910ad832e.tar.gz
Paper-7c2dc4b3429f16943300da0eb06100e910ad832e.zip
Use Codecs for adventure Component conversions & network serialization (#10014)
* finish implementing all adventure components in codecs * add some initial tests * Add round trip tests for text and translatable components * Add more round trip test data (score component is failing) * Add more round trip test data * Fix SCORE_COMPONENT_MAP_CODEC * Improve test failure messages * Add failure cases * Add a couple more test data * Make use of AdventureCodecs * Update patches after rebase * Squash changes into adventure patch * Fix AT formatting * update comment --------- Co-authored-by: Jason Penilla <[email protected]>
Diffstat (limited to 'patches/server/0423-Remove-some-streams-from-structures.patch')
-rw-r--r--patches/server/0423-Remove-some-streams-from-structures.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/patches/server/0423-Remove-some-streams-from-structures.patch b/patches/server/0423-Remove-some-streams-from-structures.patch
new file mode 100644
index 0000000000..136b102df3
--- /dev/null
+++ b/patches/server/0423-Remove-some-streams-from-structures.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: JRoy <[email protected]>
+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 bb8d8edb47621665872a5e8fc01512ba40c1b913..5d721dc196a6bde511f46dbdedb2e1d98553ac52 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 = pos.getMinBlockZ();
+ ObjectList<Beardifier.Rigid> objectList = new ObjectArrayList<>(10);
+ ObjectList<JigsawJunction> objectList2 = new ObjectArrayList<>(32);
+- world.startsForStructure(pos, (structure) -> {
++ // Paper start - replace for each
++ for (net.minecraft.world.level.levelgen.structure.StructureStart start : world.startsForStructure(pos, (structure) -> {
+ return structure.terrainAdaptation() != TerrainAdjustment.NONE;
+- }).forEach((start) -> {
++ })) { // Paper end
+ TerrainAdjustment terrainAdjustment = start.getStructure().terrainAdaptation();
+
+ for(StructurePiece structurePiece : start.getPieces()) {
+@@ -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 {
+ }
+ }
+
+- });
++ } // Paper
+ return new Beardifier(objectList.iterator(), objectList2.iterator());
+ }
+