mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
ef0e5a642d
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 9ae3f10f SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API 48c0c547 PR-786: Add methods to get sounds from entities CraftBukkit Changes: 5cc9c022a SPIGOT-7152: Handle hand item changing during air interact event 4ffa1acf6 SPIGOT-7154: Players get kicked when interacting with a conversation 4daa21123 SPIGOT-3842: Add Player#fireworkBoost() and expand Firework API e5d6a9bbf PR-1100: Add methods to get sounds from entities b7e9f1c8b SPIGOT-7146: Reduce use of Material switch in ItemMeta Spigot Changes: 4c157bb4 Rebuild patches
48 lines
2.6 KiB
Diff
48 lines
2.6 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 24f58441ae7b43a62d74aa55e9808c1c65f466e4..99e329d374b60ebf77f93551f6bf83b9bca1e4b8 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());
|
|
}
|
|
|