diff --git a/patches/server/0102-Remove-stream-in-PlacedFeature.patch b/patches/server/0102-Remove-stream-in-PlacedFeature.patch new file mode 100644 index 00000000..727df5d8 --- /dev/null +++ b/patches/server/0102-Remove-stream-in-PlacedFeature.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com> +Date: Tue, 9 Nov 2077 00:00:00 +0800 +Subject: [PATCH] Remove stream in PlacedFeature + +Stream operation in PlacedFeature take much time generating features, +replace them with for loop uwu +Before: 3684ms +After: 673ms + +diff --git a/src/main/java/net/minecraft/world/level/levelgen/placement/PlacedFeature.java b/src/main/java/net/minecraft/world/level/levelgen/placement/PlacedFeature.java +index 43ef3fdd7af5883f4846b253d76e06da0f31729e..422e9ed66052c67dab674ee548b1471307a991f5 100644 +--- a/src/main/java/net/minecraft/world/level/levelgen/placement/PlacedFeature.java ++++ b/src/main/java/net/minecraft/world/level/levelgen/placement/PlacedFeature.java +@@ -41,19 +41,25 @@ public record PlacedFeature(Holder> feature, List stream = Stream.of(pos); ++ // Leaf start - Remove stream in PlacedFeature ++ List positions = java.util.Collections.singletonList(pos); + + for (PlacementModifier placementModifier : this.placement) { +- stream = stream.flatMap(posx -> placementModifier.getPositions(context, random, posx)); ++ List newPositions = new java.util.ArrayList<>(); ++ for (BlockPos posx : positions) { ++ placementModifier.getPositions(context, random, posx).forEach(newPositions::add); ++ } ++ positions = newPositions; + } + + ConfiguredFeature configuredFeature = this.feature.value(); + MutableBoolean mutableBoolean = new MutableBoolean(); +- stream.forEach(placedPos -> { ++ for (BlockPos placedPos : positions) { + if (configuredFeature.place(context.getLevel(), context.generator(), random, placedPos)) { + mutableBoolean.setTrue(); + } +- }); ++ } ++ // Leaf end - Remove stream in PlacedFeature + return mutableBoolean.isTrue(); + } + diff --git a/patches/server/0102-Replace-Entity-active-effects-map-with-optimized-col.patch b/patches/server/0103-Replace-Entity-active-effects-map-with-optimized-col.patch similarity index 100% rename from patches/server/0102-Replace-Entity-active-effects-map-with-optimized-col.patch rename to patches/server/0103-Replace-Entity-active-effects-map-with-optimized-col.patch diff --git a/patches/server/0103-Replace-criterion-map-with-optimized-collection.patch b/patches/server/0104-Replace-criterion-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0103-Replace-criterion-map-with-optimized-collection.patch rename to patches/server/0104-Replace-criterion-map-with-optimized-collection.patch diff --git a/patches/server/0104-Replace-world-map-with-optimized-collection.patch b/patches/server/0105-Replace-world-map-with-optimized-collection.patch similarity index 100% rename from patches/server/0104-Replace-world-map-with-optimized-collection.patch rename to patches/server/0105-Replace-world-map-with-optimized-collection.patch diff --git a/patches/server/0105-Replace-brain-maps-with-optimized-collection.patch b/patches/server/0106-Replace-brain-maps-with-optimized-collection.patch similarity index 100% rename from patches/server/0105-Replace-brain-maps-with-optimized-collection.patch rename to patches/server/0106-Replace-brain-maps-with-optimized-collection.patch diff --git a/patches/server/0106-Reduce-worldgen-allocations.patch b/patches/server/0107-Reduce-worldgen-allocations.patch similarity index 100% rename from patches/server/0106-Reduce-worldgen-allocations.patch rename to patches/server/0107-Reduce-worldgen-allocations.patch diff --git a/patches/server/0107-Use-caffeine-cache-kickPermission-instead-of-using-g.patch b/patches/server/0108-Use-caffeine-cache-kickPermission-instead-of-using-g.patch similarity index 100% rename from patches/server/0107-Use-caffeine-cache-kickPermission-instead-of-using-g.patch rename to patches/server/0108-Use-caffeine-cache-kickPermission-instead-of-using-g.patch diff --git a/patches/server/0108-Do-not-place-player-if-the-server-is-full.patch b/patches/server/0109-Do-not-place-player-if-the-server-is-full.patch similarity index 100% rename from patches/server/0108-Do-not-place-player-if-the-server-is-full.patch rename to patches/server/0109-Do-not-place-player-if-the-server-is-full.patch diff --git a/patches/server/0109-Fix-MC-65198.patch b/patches/server/0110-Fix-MC-65198.patch similarity index 100% rename from patches/server/0109-Fix-MC-65198.patch rename to patches/server/0110-Fix-MC-65198.patch diff --git a/patches/server/0110-Fix-MC-183518.patch b/patches/server/0111-Fix-MC-183518.patch similarity index 100% rename from patches/server/0110-Fix-MC-183518.patch rename to patches/server/0111-Fix-MC-183518.patch diff --git a/patches/server/0111-Fix-MC-200418.patch b/patches/server/0112-Fix-MC-200418.patch similarity index 100% rename from patches/server/0111-Fix-MC-200418.patch rename to patches/server/0112-Fix-MC-200418.patch diff --git a/patches/server/0112-Fix-MC-119417.patch b/patches/server/0113-Fix-MC-119417.patch similarity index 100% rename from patches/server/0112-Fix-MC-119417.patch rename to patches/server/0113-Fix-MC-119417.patch diff --git a/patches/server/0113-Fix-MC-223153.patch b/patches/server/0114-Fix-MC-223153.patch similarity index 100% rename from patches/server/0113-Fix-MC-223153.patch rename to patches/server/0114-Fix-MC-223153.patch diff --git a/patches/server/0114-Fix-MC-177381.patch b/patches/server/0115-Fix-MC-177381.patch similarity index 100% rename from patches/server/0114-Fix-MC-177381.patch rename to patches/server/0115-Fix-MC-177381.patch diff --git a/patches/server/0115-Optimize-LeavesProtocolManager-init-protocol.patch b/patches/server/0116-Optimize-LeavesProtocolManager-init-protocol.patch similarity index 100% rename from patches/server/0115-Optimize-LeavesProtocolManager-init-protocol.patch rename to patches/server/0116-Optimize-LeavesProtocolManager-init-protocol.patch diff --git a/patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch b/patches/server/0117-Cache-CraftEntityType-minecraftToBukkit-convert.patch similarity index 100% rename from patches/server/0116-Cache-CraftEntityType-minecraftToBukkit-convert.patch rename to patches/server/0117-Cache-CraftEntityType-minecraftToBukkit-convert.patch diff --git a/patches/server/0117-Configurable-player-knockback-zombie.patch b/patches/server/0118-Configurable-player-knockback-zombie.patch similarity index 100% rename from patches/server/0117-Configurable-player-knockback-zombie.patch rename to patches/server/0118-Configurable-player-knockback-zombie.patch diff --git a/patches/server/0118-Hide-specified-item-components-to-clients.patch b/patches/server/0119-Hide-specified-item-components-to-clients.patch similarity index 100% rename from patches/server/0118-Hide-specified-item-components-to-clients.patch rename to patches/server/0119-Hide-specified-item-components-to-clients.patch diff --git a/patches/server/0119-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch b/patches/server/0120-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch similarity index 100% rename from patches/server/0119-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch rename to patches/server/0120-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch diff --git a/patches/server/0120-Paper-PR-Reduce-work-done-in-CraftMapCanvas.drawImag.patch b/patches/server/0121-Paper-PR-Reduce-work-done-in-CraftMapCanvas.drawImag.patch similarity index 100% rename from patches/server/0120-Paper-PR-Reduce-work-done-in-CraftMapCanvas.drawImag.patch rename to patches/server/0121-Paper-PR-Reduce-work-done-in-CraftMapCanvas.drawImag.patch diff --git a/patches/server/0121-Paper-PR-Throttle-failed-spawn-attempts.patch b/patches/server/0122-Paper-PR-Throttle-failed-spawn-attempts.patch similarity index 100% rename from patches/server/0121-Paper-PR-Throttle-failed-spawn-attempts.patch rename to patches/server/0122-Paper-PR-Throttle-failed-spawn-attempts.patch diff --git a/patches/server/0122-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch b/patches/server/0123-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch similarity index 100% rename from patches/server/0122-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch rename to patches/server/0123-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch diff --git a/patches/server/0123-Dont-send-useless-entity-packets.patch b/patches/server/0124-Dont-send-useless-entity-packets.patch similarity index 100% rename from patches/server/0123-Dont-send-useless-entity-packets.patch rename to patches/server/0124-Dont-send-useless-entity-packets.patch diff --git a/patches/server/0124-Don-t-spawn-if-lastSpawnState-is-null.patch b/patches/server/0125-Don-t-spawn-if-lastSpawnState-is-null.patch similarity index 100% rename from patches/server/0124-Don-t-spawn-if-lastSpawnState-is-null.patch rename to patches/server/0125-Don-t-spawn-if-lastSpawnState-is-null.patch diff --git a/patches/server/0125-Multithreaded-Tracker.patch b/patches/server/0126-Multithreaded-Tracker.patch similarity index 100% rename from patches/server/0125-Multithreaded-Tracker.patch rename to patches/server/0126-Multithreaded-Tracker.patch diff --git a/patches/server/0126-Nitori-Async-playerdata-Save.patch b/patches/server/0127-Nitori-Async-playerdata-Save.patch similarity index 100% rename from patches/server/0126-Nitori-Async-playerdata-Save.patch rename to patches/server/0127-Nitori-Async-playerdata-Save.patch diff --git a/patches/server/0127-Change-max-stack-count.patch b/patches/server/0128-Change-max-stack-count.patch similarity index 100% rename from patches/server/0127-Change-max-stack-count.patch rename to patches/server/0128-Change-max-stack-count.patch diff --git a/patches/server/0128-Reduce-object-complexity-to-make-block-isValid-calls.patch b/patches/server/0129-Reduce-object-complexity-to-make-block-isValid-calls.patch similarity index 100% rename from patches/server/0128-Reduce-object-complexity-to-make-block-isValid-calls.patch rename to patches/server/0129-Reduce-object-complexity-to-make-block-isValid-calls.patch diff --git a/patches/server/0129-Optimize-nearby-alive-players-for-spawning.patch b/patches/server/0130-Optimize-nearby-alive-players-for-spawning.patch similarity index 100% rename from patches/server/0129-Optimize-nearby-alive-players-for-spawning.patch rename to patches/server/0130-Optimize-nearby-alive-players-for-spawning.patch diff --git a/patches/server/0130-Cache-blockstate-cache.patch b/patches/server/0131-Cache-blockstate-cache.patch similarity index 100% rename from patches/server/0130-Cache-blockstate-cache.patch rename to patches/server/0131-Cache-blockstate-cache.patch diff --git a/patches/server/0131-Asynchronous-locator.patch b/patches/server/0132-Asynchronous-locator.patch similarity index 100% rename from patches/server/0131-Asynchronous-locator.patch rename to patches/server/0132-Asynchronous-locator.patch diff --git a/patches/server/0132-Smart-sort-entities-in-NearestLivingEntitySensor.patch b/patches/server/0133-Smart-sort-entities-in-NearestLivingEntitySensor.patch similarity index 100% rename from patches/server/0132-Smart-sort-entities-in-NearestLivingEntitySensor.patch rename to patches/server/0133-Smart-sort-entities-in-NearestLivingEntitySensor.patch diff --git a/patches/server/0133-Further-reduce-memory-footprint-of-CompoundTag.patch b/patches/server/0134-Further-reduce-memory-footprint-of-CompoundTag.patch similarity index 100% rename from patches/server/0133-Further-reduce-memory-footprint-of-CompoundTag.patch rename to patches/server/0134-Further-reduce-memory-footprint-of-CompoundTag.patch diff --git a/patches/server/0134-Optimize-Entity-distanceToSqr.patch b/patches/server/0135-Optimize-Entity-distanceToSqr.patch similarity index 100% rename from patches/server/0134-Optimize-Entity-distanceToSqr.patch rename to patches/server/0135-Optimize-Entity-distanceToSqr.patch diff --git a/patches/server/0135-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch b/patches/server/0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch similarity index 100% rename from patches/server/0135-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch rename to patches/server/0136-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch diff --git a/patches/server/0136-EMC-Default-don-t-use-blockstate-snapshots.patch b/patches/server/0137-EMC-Default-don-t-use-blockstate-snapshots.patch similarity index 100% rename from patches/server/0136-EMC-Default-don-t-use-blockstate-snapshots.patch rename to patches/server/0137-EMC-Default-don-t-use-blockstate-snapshots.patch diff --git a/patches/server/0137-Cache-tile-entity-position.patch b/patches/server/0138-Cache-tile-entity-position.patch similarity index 100% rename from patches/server/0137-Cache-tile-entity-position.patch rename to patches/server/0138-Cache-tile-entity-position.patch diff --git a/patches/server/0138-TT20-Lag-compensation.patch b/patches/server/0139-TT20-Lag-compensation.patch similarity index 100% rename from patches/server/0138-TT20-Lag-compensation.patch rename to patches/server/0139-TT20-Lag-compensation.patch diff --git a/patches/server/0139-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch b/patches/server/0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch similarity index 100% rename from patches/server/0139-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch rename to patches/server/0140-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch diff --git a/patches/server/0140-C2ME-Reduce-Allocations.patch b/patches/server/0141-C2ME-Reduce-Allocations.patch similarity index 100% rename from patches/server/0140-C2ME-Reduce-Allocations.patch rename to patches/server/0141-C2ME-Reduce-Allocations.patch diff --git a/patches/server/0141-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch b/patches/server/0142-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch similarity index 100% rename from patches/server/0141-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch rename to patches/server/0142-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch diff --git a/patches/server/0142-Lithium-fast-util.patch b/patches/server/0143-Lithium-fast-util.patch similarity index 100% rename from patches/server/0142-Lithium-fast-util.patch rename to patches/server/0143-Lithium-fast-util.patch diff --git a/patches/server/0143-Lithium-CompactSineLUT.patch b/patches/server/0144-Lithium-CompactSineLUT.patch similarity index 100% rename from patches/server/0143-Lithium-CompactSineLUT.patch rename to patches/server/0144-Lithium-CompactSineLUT.patch diff --git a/patches/server/0144-Lithium-IterateOutwardsCache.patch b/patches/server/0145-Lithium-IterateOutwardsCache.patch similarity index 100% rename from patches/server/0144-Lithium-IterateOutwardsCache.patch rename to patches/server/0145-Lithium-IterateOutwardsCache.patch diff --git a/patches/server/0145-Lithium-HashedList.patch b/patches/server/0146-Lithium-HashedList.patch similarity index 100% rename from patches/server/0145-Lithium-HashedList.patch rename to patches/server/0146-Lithium-HashedList.patch diff --git a/patches/server/0146-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch b/patches/server/0147-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch similarity index 100% rename from patches/server/0146-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch rename to patches/server/0147-Use-MCUtil.asyncExecutor-for-MAIN_WORKER_EXECUTOR.patch diff --git a/patches/server/0147-Better-inline-world-height.patch b/patches/server/0148-Better-inline-world-height.patch similarity index 100% rename from patches/server/0147-Better-inline-world-height.patch rename to patches/server/0148-Better-inline-world-height.patch diff --git a/patches/server/0148-Branchless-clamp-logic.patch b/patches/server/0149-Branchless-clamp-logic.patch similarity index 100% rename from patches/server/0148-Branchless-clamp-logic.patch rename to patches/server/0149-Branchless-clamp-logic.patch diff --git a/patches/server/0149-Use-faster-and-thread-safe-ban-list-date-format-pars.patch b/patches/server/0150-Use-faster-and-thread-safe-ban-list-date-format-pars.patch similarity index 100% rename from patches/server/0149-Use-faster-and-thread-safe-ban-list-date-format-pars.patch rename to patches/server/0150-Use-faster-and-thread-safe-ban-list-date-format-pars.patch