From e7c221e91dda36a08ff68bd879e89b157298fc43 Mon Sep 17 00:00:00 2001 From: hayanesuru Date: Sun, 29 Jun 2025 13:47:48 +0900 Subject: [PATCH] backport some fixes in async target finding cb21caa1c2d10a733e7fe48f7a01676efd6774de 58575d0adc2ccc9e2d4707ebf8868878ed3cbfbf --- ...writeLongArray-during-chunk-loading.patch} | 0 ...1-Improve-sorting-in-SortedArraySet.patch} | 0 ... 0122-Make-removeIf-slightly-faster.patch} | 0 ...atch => 0123-Optimize-LinearPalette.patch} | 0 ...124-Slightly-optimized-VarInt-write.patch} | 0 ...te-ClientboundLightUpdatePacketData.patch} | 0 ...send.patch => 0126-Async-chunk-send.patch} | 0 ...atch => 0127-Spawner-Configurations.patch} | 0 ...SparklyPaper-Parallel-world-ticking.patch} | 2 +- ...-SparklyPaper-Track-each-world-MSPT.patch} | 0 ...lled-Projectile-Events-still-consum.patch} | 2 +- ...ndInteract-and-NearestVisibleLiving.patch} | 0 ...emove-streams-on-InsideBrownianWalk.patch} | 0 ...=> 0133-Use-BFS-on-getSlopeDistance.patch} | 0 ...r-PR-Throttle-failed-spawn-attempts.patch} | 0 ...BlockEntity-ticking-isRemoved-check.patch} | 0 ...6-Raytrace-AntiXray-SDK-integration.patch} | 2 +- ...timize-addOrUpdateTransientModifier.patch} | 0 ... => 0138-Optimize-ContextMap.create.patch} | 0 ...Micro-optimizations-for-random-tick.patch} | 0 ...n-updateConnectedPlayersWithinRange.patch} | 0 ...41-Remove-streams-on-PlayerDetector.patch} | 0 ...se-direct-iteration-on-Sensing.tick.patch} | 0 ...3-Optimise-non-flush-packet-sending.patch} | 0 ...unk-retrieving-in-entity-fluid-push.patch} | 0 ...-Null-handling-on-MultifaceSpreader.patch} | 0 ....patch => 0146-More-virtual-threads.patch} | 0 ....patch => 0147-Async-target-finding.patch} | 164 +++++++++++------- ...imize-ThreadedTicketLevelPropagator.patch} | 0 ...EffectUtil-getDigSpeedAmplification.patch} | 0 ...patch => 0150-Optimise-chunkUnloads.patch} | 0 ...51-Optimize-BlockEntityType-isValid.patch} | 0 ...t-on-player-join-to-avoid-chunk-loa.patch} | 0 ...rPR-Fix-save-load-NaN-Entity-Motion.patch} | 0 ...erPR-Fix-unnecessary-map-data-saves.patch} | 0 ...heck-inside-blocks-and-traverse-blo.patch} | 0 ...yList-implementation-to-BasicEntity.patch} | 0 ...ol-Core.patch => 0157-Protocol-Core.patch} | 0 ... => 0158-Reduce-PlayerChunk-Updates.patch} | 0 ... 0159-Async-switch-connection-state.patch} | 0 ...timize-BlockEntities-tickersInLevel.patch} | 0 ...e-cactus-can-even-survive-being-pla.patch} | 0 ...0162-Flush-location-while-knockback.patch} | 0 ...tch => 0163-Only-tick-items-at-hand.patch} | 0 ...art-sort-items-in-NearestItemSensor.patch} | 0 ...165-Optimise-player-movement-checks.patch} | 0 ...=> 0166-Remove-streams-in-MobSensor.patch} | 0 ...67-Remove-streams-in-TemptingSensor.patch} | 0 ...se-HashedList-on-WeightedRandomList.patch} | 0 ...-death-item-drop-knockback-settings.patch} | 0 ...-Optimize-getScaledTrackingDistance.patch} | 0 ...ptimize-SynchedEntityData-packDirty.patch} | 0 ...patch => 0172-Optimize-isEyeInFluid.patch} | 0 ...patch => 0173-Cache-block-path-type.patch} | 0 ...ch => 0174-optimize-getEntityStatus.patch} | 0 ...on-optimized-PoweredRailBlock-logic.patch} | 0 ...6-optimise-ChunkGenerator-getMobsAt.patch} | 0 ...ome.patch => 0177-optimise-getBiome.patch} | 0 ...patch => 0178-optimize-mob-spawning.patch} | 4 +- ...atch => 0179-optimize-structure-map.patch} | 0 ...patch => 0180-throttle-mob-spawning.patch} | 0 ... => 0181-Add-BlockExplosionHitEvent.patch} | 0 ...last-Protection-explosion-knockback.patch} | 0 ...> 0183-Use-UUID-for-cure-reputation.patch} | 0 ...-Cache-potential-behaviors-in-Brain.patch} | 0 ...-ActivationList-on-runningBehaviors.patch} | 0 ...-Fix-infinite-loop-in-RegionFile-IO.patch} | 0 ... 0187-Paper-Fix-excess-slot-updates.patch} | 2 +- ...ing-parsing-unknown-command-message.patch} | 0 ...tion.patch => 0189-Paw-optimization.patch} | 2 +- ....patch => 0190-optimize-random-tick.patch} | 4 +- 71 files changed, 109 insertions(+), 73 deletions(-) rename leaf-server/minecraft-patches/features/{0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch => 0120-Bulk-writes-to-writeLongArray-during-chunk-loading.patch} (100%) rename leaf-server/minecraft-patches/features/{0123-Improve-sorting-in-SortedArraySet.patch => 0121-Improve-sorting-in-SortedArraySet.patch} (100%) rename leaf-server/minecraft-patches/features/{0124-Make-removeIf-slightly-faster.patch => 0122-Make-removeIf-slightly-faster.patch} (100%) rename leaf-server/minecraft-patches/features/{0125-Optimize-LinearPalette.patch => 0123-Optimize-LinearPalette.patch} (100%) rename leaf-server/minecraft-patches/features/{0126-Slightly-optimized-VarInt-write.patch => 0124-Slightly-optimized-VarInt-write.patch} (100%) rename leaf-server/minecraft-patches/features/{0127-Rewrite-ClientboundLightUpdatePacketData.patch => 0125-Rewrite-ClientboundLightUpdatePacketData.patch} (100%) rename leaf-server/minecraft-patches/features/{0128-Async-chunk-send.patch => 0126-Async-chunk-send.patch} (100%) rename leaf-server/minecraft-patches/features/{0129-Spawner-Configurations.patch => 0127-Spawner-Configurations.patch} (100%) rename leaf-server/minecraft-patches/features/{0130-SparklyPaper-Parallel-world-ticking.patch => 0128-SparklyPaper-Parallel-world-ticking.patch} (99%) rename leaf-server/minecraft-patches/features/{0131-SparklyPaper-Track-each-world-MSPT.patch => 0129-SparklyPaper-Track-each-world-MSPT.patch} (100%) rename leaf-server/minecraft-patches/features/{0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch => 0130-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch} (99%) rename leaf-server/minecraft-patches/features/{0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch => 0131-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch} (100%) rename leaf-server/minecraft-patches/features/{0134-Remove-streams-on-InsideBrownianWalk.patch => 0132-Remove-streams-on-InsideBrownianWalk.patch} (100%) rename leaf-server/minecraft-patches/features/{0135-Use-BFS-on-getSlopeDistance.patch => 0133-Use-BFS-on-getSlopeDistance.patch} (100%) rename leaf-server/minecraft-patches/features/{0136-Paper-PR-Throttle-failed-spawn-attempts.patch => 0134-Paper-PR-Throttle-failed-spawn-attempts.patch} (100%) rename leaf-server/minecraft-patches/features/{0137-Improve-BlockEntity-ticking-isRemoved-check.patch => 0135-Improve-BlockEntity-ticking-isRemoved-check.patch} (100%) rename leaf-server/minecraft-patches/features/{0138-Raytrace-AntiXray-SDK-integration.patch => 0136-Raytrace-AntiXray-SDK-integration.patch} (96%) rename leaf-server/minecraft-patches/features/{0139-Optimize-addOrUpdateTransientModifier.patch => 0137-Optimize-addOrUpdateTransientModifier.patch} (100%) rename leaf-server/minecraft-patches/features/{0140-Optimize-ContextMap.create.patch => 0138-Optimize-ContextMap.create.patch} (100%) rename leaf-server/minecraft-patches/features/{0141-Micro-optimizations-for-random-tick.patch => 0139-Micro-optimizations-for-random-tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch => 0140-Remove-streams-on-updateConnectedPlayersWithinRange.patch} (100%) rename leaf-server/minecraft-patches/features/{0143-Remove-streams-on-PlayerDetector.patch => 0141-Remove-streams-on-PlayerDetector.patch} (100%) rename leaf-server/minecraft-patches/features/{0144-Use-direct-iteration-on-Sensing.tick.patch => 0142-Use-direct-iteration-on-Sensing.tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0145-Optimise-non-flush-packet-sending.patch => 0143-Optimise-non-flush-packet-sending.patch} (100%) rename leaf-server/minecraft-patches/features/{0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch => 0144-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch} (100%) rename leaf-server/minecraft-patches/features/{0147-Null-handling-on-MultifaceSpreader.patch => 0145-Null-handling-on-MultifaceSpreader.patch} (100%) rename leaf-server/minecraft-patches/features/{0148-More-virtual-threads.patch => 0146-More-virtual-threads.patch} (100%) rename leaf-server/minecraft-patches/features/{0149-Async-target-finding.patch => 0147-Async-target-finding.patch} (94%) rename leaf-server/minecraft-patches/features/{0150-Optimize-ThreadedTicketLevelPropagator.patch => 0148-Optimize-ThreadedTicketLevelPropagator.patch} (100%) rename leaf-server/minecraft-patches/features/{0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch => 0149-Optimise-MobEffectUtil-getDigSpeedAmplification.patch} (100%) rename leaf-server/minecraft-patches/features/{0152-Optimise-chunkUnloads.patch => 0150-Optimise-chunkUnloads.patch} (100%) rename leaf-server/minecraft-patches/features/{0153-Optimize-BlockEntityType-isValid.patch => 0151-Optimize-BlockEntityType-isValid.patch} (100%) rename leaf-server/minecraft-patches/features/{0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch => 0152-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch} (100%) rename leaf-server/minecraft-patches/features/{0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch => 0153-PaperPR-Fix-save-load-NaN-Entity-Motion.patch} (100%) rename leaf-server/minecraft-patches/features/{0156-PaperPR-Fix-unnecessary-map-data-saves.patch => 0154-PaperPR-Fix-unnecessary-map-data-saves.patch} (100%) rename leaf-server/minecraft-patches/features/{0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch => 0155-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch} (100%) rename leaf-server/minecraft-patches/features/{0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch => 0156-Sakura-copy-EntityList-implementation-to-BasicEntity.patch} (100%) rename leaf-server/minecraft-patches/features/{0159-Protocol-Core.patch => 0157-Protocol-Core.patch} (100%) rename leaf-server/minecraft-patches/features/{0160-Reduce-PlayerChunk-Updates.patch => 0158-Reduce-PlayerChunk-Updates.patch} (100%) rename leaf-server/minecraft-patches/features/{0161-Async-switch-connection-state.patch => 0159-Async-switch-connection-state.patch} (100%) rename leaf-server/minecraft-patches/features/{0162-Optimize-BlockEntities-tickersInLevel.patch => 0160-Optimize-BlockEntities-tickersInLevel.patch} (100%) rename leaf-server/minecraft-patches/features/{0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch => 0161-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch} (100%) rename leaf-server/minecraft-patches/features/{0164-Flush-location-while-knockback.patch => 0162-Flush-location-while-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0165-Only-tick-items-at-hand.patch => 0163-Only-tick-items-at-hand.patch} (100%) rename leaf-server/minecraft-patches/features/{0166-Smart-sort-items-in-NearestItemSensor.patch => 0164-Smart-sort-items-in-NearestItemSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0167-Optimise-player-movement-checks.patch => 0165-Optimise-player-movement-checks.patch} (100%) rename leaf-server/minecraft-patches/features/{0168-Remove-streams-in-MobSensor.patch => 0166-Remove-streams-in-MobSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0169-Remove-streams-in-TemptingSensor.patch => 0167-Remove-streams-in-TemptingSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0170-Use-HashedList-on-WeightedRandomList.patch => 0168-Use-HashedList-on-WeightedRandomList.patch} (100%) rename leaf-server/minecraft-patches/features/{0171-Add-configurable-death-item-drop-knockback-settings.patch => 0169-Add-configurable-death-item-drop-knockback-settings.patch} (100%) rename leaf-server/minecraft-patches/features/{0172-Optimize-getScaledTrackingDistance.patch => 0170-Optimize-getScaledTrackingDistance.patch} (100%) rename leaf-server/minecraft-patches/features/{0173-Optimize-SynchedEntityData-packDirty.patch => 0171-Optimize-SynchedEntityData-packDirty.patch} (100%) rename leaf-server/minecraft-patches/features/{0174-Optimize-isEyeInFluid.patch => 0172-Optimize-isEyeInFluid.patch} (100%) rename leaf-server/minecraft-patches/features/{0175-Cache-block-path-type.patch => 0173-Cache-block-path-type.patch} (100%) rename leaf-server/minecraft-patches/features/{0176-optimize-getEntityStatus.patch => 0174-optimize-getEntityStatus.patch} (100%) rename leaf-server/minecraft-patches/features/{0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch => 0175-Rail-Optimization-optimized-PoweredRailBlock-logic.patch} (100%) rename leaf-server/minecraft-patches/features/{0178-optimise-ChunkGenerator-getMobsAt.patch => 0176-optimise-ChunkGenerator-getMobsAt.patch} (100%) rename leaf-server/minecraft-patches/features/{0179-optimise-getBiome.patch => 0177-optimise-getBiome.patch} (100%) rename leaf-server/minecraft-patches/features/{0180-optimize-mob-spawning.patch => 0178-optimize-mob-spawning.patch} (98%) rename leaf-server/minecraft-patches/features/{0181-optimize-structure-map.patch => 0179-optimize-structure-map.patch} (100%) rename leaf-server/minecraft-patches/features/{0182-throttle-mob-spawning.patch => 0180-throttle-mob-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0183-Add-BlockExplosionHitEvent.patch => 0181-Add-BlockExplosionHitEvent.patch} (100%) rename leaf-server/minecraft-patches/features/{0184-Old-Blast-Protection-explosion-knockback.patch => 0182-Old-Blast-Protection-explosion-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0185-Use-UUID-for-cure-reputation.patch => 0183-Use-UUID-for-cure-reputation.patch} (100%) rename leaf-server/minecraft-patches/features/{0186-Cache-potential-behaviors-in-Brain.patch => 0184-Cache-potential-behaviors-in-Brain.patch} (100%) rename leaf-server/minecraft-patches/features/{0187-Use-ActivationList-on-runningBehaviors.patch => 0185-Use-ActivationList-on-runningBehaviors.patch} (100%) rename leaf-server/minecraft-patches/features/{0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch => 0186-Paper-Fix-infinite-loop-in-RegionFile-IO.patch} (100%) rename leaf-server/minecraft-patches/features/{0189-Paper-Fix-excess-slot-updates.patch => 0187-Paper-Fix-excess-slot-updates.patch} (94%) rename leaf-server/minecraft-patches/features/{0190-Fix-crash-during-parsing-unknown-command-message.patch => 0188-Fix-crash-during-parsing-unknown-command-message.patch} (100%) rename leaf-server/minecraft-patches/features/{0191-Paw-optimization.patch => 0189-Paw-optimization.patch} (99%) rename leaf-server/minecraft-patches/features/{0192-optimize-random-tick.patch => 0190-optimize-random-tick.patch} (97%) diff --git a/leaf-server/minecraft-patches/features/0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch b/leaf-server/minecraft-patches/features/0120-Bulk-writes-to-writeLongArray-during-chunk-loading.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0122-Bulk-writes-to-writeLongArray-during-chunk-loading.patch rename to leaf-server/minecraft-patches/features/0120-Bulk-writes-to-writeLongArray-during-chunk-loading.patch diff --git a/leaf-server/minecraft-patches/features/0123-Improve-sorting-in-SortedArraySet.patch b/leaf-server/minecraft-patches/features/0121-Improve-sorting-in-SortedArraySet.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0123-Improve-sorting-in-SortedArraySet.patch rename to leaf-server/minecraft-patches/features/0121-Improve-sorting-in-SortedArraySet.patch diff --git a/leaf-server/minecraft-patches/features/0124-Make-removeIf-slightly-faster.patch b/leaf-server/minecraft-patches/features/0122-Make-removeIf-slightly-faster.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0124-Make-removeIf-slightly-faster.patch rename to leaf-server/minecraft-patches/features/0122-Make-removeIf-slightly-faster.patch diff --git a/leaf-server/minecraft-patches/features/0125-Optimize-LinearPalette.patch b/leaf-server/minecraft-patches/features/0123-Optimize-LinearPalette.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0125-Optimize-LinearPalette.patch rename to leaf-server/minecraft-patches/features/0123-Optimize-LinearPalette.patch diff --git a/leaf-server/minecraft-patches/features/0126-Slightly-optimized-VarInt-write.patch b/leaf-server/minecraft-patches/features/0124-Slightly-optimized-VarInt-write.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0126-Slightly-optimized-VarInt-write.patch rename to leaf-server/minecraft-patches/features/0124-Slightly-optimized-VarInt-write.patch diff --git a/leaf-server/minecraft-patches/features/0127-Rewrite-ClientboundLightUpdatePacketData.patch b/leaf-server/minecraft-patches/features/0125-Rewrite-ClientboundLightUpdatePacketData.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0127-Rewrite-ClientboundLightUpdatePacketData.patch rename to leaf-server/minecraft-patches/features/0125-Rewrite-ClientboundLightUpdatePacketData.patch diff --git a/leaf-server/minecraft-patches/features/0128-Async-chunk-send.patch b/leaf-server/minecraft-patches/features/0126-Async-chunk-send.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0128-Async-chunk-send.patch rename to leaf-server/minecraft-patches/features/0126-Async-chunk-send.patch diff --git a/leaf-server/minecraft-patches/features/0129-Spawner-Configurations.patch b/leaf-server/minecraft-patches/features/0127-Spawner-Configurations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0129-Spawner-Configurations.patch rename to leaf-server/minecraft-patches/features/0127-Spawner-Configurations.patch diff --git a/leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch b/leaf-server/minecraft-patches/features/0128-SparklyPaper-Parallel-world-ticking.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch rename to leaf-server/minecraft-patches/features/0128-SparklyPaper-Parallel-world-ticking.patch index 682d4859..be19a06a 100644 --- a/leaf-server/minecraft-patches/features/0130-SparklyPaper-Parallel-world-ticking.patch +++ b/leaf-server/minecraft-patches/features/0128-SparklyPaper-Parallel-world-ticking.patch @@ -1202,7 +1202,7 @@ index aa2c00be86f42a6674694a20545399e441b75199..c098fe283e74ca77e7a47c898cd39a2d serverLevel.capturedBlockStates.clear(); org.bukkit.event.world.StructureGrowEvent structureEvent = null; diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 7d3163802640449b6bdaa93595518d7d0f62488b..4821ab14c6a7d5738f0fc93523aede5ea904aa84 100644 +index 859c9cc198c3e17be7b761a91a7426f3a3a53c1c..33c016d44f0318ceba5bb622623fba9f620d98a7 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -175,6 +175,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0131-SparklyPaper-Track-each-world-MSPT.patch b/leaf-server/minecraft-patches/features/0129-SparklyPaper-Track-each-world-MSPT.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0131-SparklyPaper-Track-each-world-MSPT.patch rename to leaf-server/minecraft-patches/features/0129-SparklyPaper-Track-each-world-MSPT.patch diff --git a/leaf-server/minecraft-patches/features/0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch b/leaf-server/minecraft-patches/features/0130-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch rename to leaf-server/minecraft-patches/features/0130-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch index 2154ebe6..8fb8c041 100644 --- a/leaf-server/minecraft-patches/features/0132-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch +++ b/leaf-server/minecraft-patches/features/0130-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch @@ -229,7 +229,7 @@ index f20c38c1ff978d00dc0c9810c050506deed44ebd..e58a40623c3a259c80d0f96686797445 player.getInventory().removeItem(ammo); } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 4821ab14c6a7d5738f0fc93523aede5ea904aa84..e0d9d7075b2c10f686c8c144c9869fa574cd19d3 100644 +index 33c016d44f0318ceba5bb622623fba9f620d98a7..4ccffc5db803dac847dcaccc53681161dc15827d 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -182,6 +182,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch b/leaf-server/minecraft-patches/features/0131-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0133-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch rename to leaf-server/minecraft-patches/features/0131-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch diff --git a/leaf-server/minecraft-patches/features/0134-Remove-streams-on-InsideBrownianWalk.patch b/leaf-server/minecraft-patches/features/0132-Remove-streams-on-InsideBrownianWalk.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0134-Remove-streams-on-InsideBrownianWalk.patch rename to leaf-server/minecraft-patches/features/0132-Remove-streams-on-InsideBrownianWalk.patch diff --git a/leaf-server/minecraft-patches/features/0135-Use-BFS-on-getSlopeDistance.patch b/leaf-server/minecraft-patches/features/0133-Use-BFS-on-getSlopeDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0135-Use-BFS-on-getSlopeDistance.patch rename to leaf-server/minecraft-patches/features/0133-Use-BFS-on-getSlopeDistance.patch diff --git a/leaf-server/minecraft-patches/features/0136-Paper-PR-Throttle-failed-spawn-attempts.patch b/leaf-server/minecraft-patches/features/0134-Paper-PR-Throttle-failed-spawn-attempts.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0136-Paper-PR-Throttle-failed-spawn-attempts.patch rename to leaf-server/minecraft-patches/features/0134-Paper-PR-Throttle-failed-spawn-attempts.patch diff --git a/leaf-server/minecraft-patches/features/0137-Improve-BlockEntity-ticking-isRemoved-check.patch b/leaf-server/minecraft-patches/features/0135-Improve-BlockEntity-ticking-isRemoved-check.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0137-Improve-BlockEntity-ticking-isRemoved-check.patch rename to leaf-server/minecraft-patches/features/0135-Improve-BlockEntity-ticking-isRemoved-check.patch diff --git a/leaf-server/minecraft-patches/features/0138-Raytrace-AntiXray-SDK-integration.patch b/leaf-server/minecraft-patches/features/0136-Raytrace-AntiXray-SDK-integration.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0138-Raytrace-AntiXray-SDK-integration.patch rename to leaf-server/minecraft-patches/features/0136-Raytrace-AntiXray-SDK-integration.patch index 4489f8b1..ee15cc9b 100644 --- a/leaf-server/minecraft-patches/features/0138-Raytrace-AntiXray-SDK-integration.patch +++ b/leaf-server/minecraft-patches/features/0136-Raytrace-AntiXray-SDK-integration.patch @@ -25,7 +25,7 @@ index a660bad3dfdb442c6aca5eb939ee103e14d37b4b..7e4cfe12312e0e36a6a19210cd76858a } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index e0d9d7075b2c10f686c8c144c9869fa574cd19d3..ac7729d1caa80155697bfe0e8646e4eda5d1780e 100644 +index 4ccffc5db803dac847dcaccc53681161dc15827d..41b67fda739ca98383f9f795d97b01969e85e609 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -1191,6 +1191,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0139-Optimize-addOrUpdateTransientModifier.patch b/leaf-server/minecraft-patches/features/0137-Optimize-addOrUpdateTransientModifier.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0139-Optimize-addOrUpdateTransientModifier.patch rename to leaf-server/minecraft-patches/features/0137-Optimize-addOrUpdateTransientModifier.patch diff --git a/leaf-server/minecraft-patches/features/0140-Optimize-ContextMap.create.patch b/leaf-server/minecraft-patches/features/0138-Optimize-ContextMap.create.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0140-Optimize-ContextMap.create.patch rename to leaf-server/minecraft-patches/features/0138-Optimize-ContextMap.create.patch diff --git a/leaf-server/minecraft-patches/features/0141-Micro-optimizations-for-random-tick.patch b/leaf-server/minecraft-patches/features/0139-Micro-optimizations-for-random-tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0141-Micro-optimizations-for-random-tick.patch rename to leaf-server/minecraft-patches/features/0139-Micro-optimizations-for-random-tick.patch diff --git a/leaf-server/minecraft-patches/features/0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch b/leaf-server/minecraft-patches/features/0140-Remove-streams-on-updateConnectedPlayersWithinRange.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0142-Remove-streams-on-updateConnectedPlayersWithinRange.patch rename to leaf-server/minecraft-patches/features/0140-Remove-streams-on-updateConnectedPlayersWithinRange.patch diff --git a/leaf-server/minecraft-patches/features/0143-Remove-streams-on-PlayerDetector.patch b/leaf-server/minecraft-patches/features/0141-Remove-streams-on-PlayerDetector.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0143-Remove-streams-on-PlayerDetector.patch rename to leaf-server/minecraft-patches/features/0141-Remove-streams-on-PlayerDetector.patch diff --git a/leaf-server/minecraft-patches/features/0144-Use-direct-iteration-on-Sensing.tick.patch b/leaf-server/minecraft-patches/features/0142-Use-direct-iteration-on-Sensing.tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0144-Use-direct-iteration-on-Sensing.tick.patch rename to leaf-server/minecraft-patches/features/0142-Use-direct-iteration-on-Sensing.tick.patch diff --git a/leaf-server/minecraft-patches/features/0145-Optimise-non-flush-packet-sending.patch b/leaf-server/minecraft-patches/features/0143-Optimise-non-flush-packet-sending.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0145-Optimise-non-flush-packet-sending.patch rename to leaf-server/minecraft-patches/features/0143-Optimise-non-flush-packet-sending.patch diff --git a/leaf-server/minecraft-patches/features/0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch b/leaf-server/minecraft-patches/features/0144-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0146-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch rename to leaf-server/minecraft-patches/features/0144-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch diff --git a/leaf-server/minecraft-patches/features/0147-Null-handling-on-MultifaceSpreader.patch b/leaf-server/minecraft-patches/features/0145-Null-handling-on-MultifaceSpreader.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0147-Null-handling-on-MultifaceSpreader.patch rename to leaf-server/minecraft-patches/features/0145-Null-handling-on-MultifaceSpreader.patch diff --git a/leaf-server/minecraft-patches/features/0148-More-virtual-threads.patch b/leaf-server/minecraft-patches/features/0146-More-virtual-threads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0148-More-virtual-threads.patch rename to leaf-server/minecraft-patches/features/0146-More-virtual-threads.patch diff --git a/leaf-server/minecraft-patches/features/0149-Async-target-finding.patch b/leaf-server/minecraft-patches/features/0147-Async-target-finding.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0149-Async-target-finding.patch rename to leaf-server/minecraft-patches/features/0147-Async-target-finding.patch index 8d3d7b06..a68b991d 100644 --- a/leaf-server/minecraft-patches/features/0149-Async-target-finding.patch +++ b/leaf-server/minecraft-patches/features/0147-Async-target-finding.patch @@ -581,7 +581,7 @@ index 3093f03d4f298bf39fec8bad2b6c22518774aea8..4eec8eda6ea1698529e0392bc75c07be } else { this.parent = animal; diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java -index e82e32407cec6109b9c3b0106295217f4a3f4aa2..0998aa502b5a361558f1812bf93c2e01c8bb0ba8 100644 +index e82e32407cec6109b9c3b0106295217f4a3f4aa2..127609e53f566413f93b983719604858802d8a6d 100644 --- a/net/minecraft/world/entity/ai/goal/GoalSelector.java +++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java @@ -26,13 +26,23 @@ public class GoalSelector { @@ -767,7 +767,7 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..0998aa502b5a361558f1812bf93c2e01 for (WrappedGoal wrappedGoal : this.availableGoals) { if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams wrappedGoal.stop(); -@@ -116,6 +256,18 @@ public class GoalSelector { +@@ -116,6 +256,24 @@ public class GoalSelector { } public void tickRunningGoals(boolean tickAllRunning) { @@ -779,6 +779,12 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..0998aa502b5a361558f1812bf93c2e01 + availableGoalsDirty = false; + } + ctxState = tickAllRunning ? 2 : 3; ++ } else { ++ for (WrappedGoal wrappedGoal : java.util.Objects.requireNonNull(this.ctxGoals)) { ++ if (wrappedGoal.isRunning() && (tickAllRunning || wrappedGoal.requiresUpdateEveryTick())) { ++ wrappedGoal.tick(); ++ } ++ } + } + return; + } @@ -787,7 +793,7 @@ index e82e32407cec6109b9c3b0106295217f4a3f4aa2..0998aa502b5a361558f1812bf93c2e01 if (wrappedGoal.isRunning() && (tickAllRunning || wrappedGoal.requiresUpdateEveryTick())) { wrappedGoal.tick(); diff --git a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java -index be59d0c27a83b329ec3f97c029cfb9c114e22472..888fd1919954acf3ec3c5d5a115dffc2e0fd3caf 100644 +index be59d0c27a83b329ec3f97c029cfb9c114e22472..83a0e5ffad44a628b60a6a2cc136559b0a0377f3 100644 --- a/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java +++ b/net/minecraft/world/entity/ai/goal/LlamaFollowCaravanGoal.java @@ -20,20 +20,83 @@ public class LlamaFollowCaravanGoal extends Goal { @@ -852,7 +858,7 @@ index be59d0c27a83b329ec3f97c029cfb9c114e22472..888fd1919954acf3ec3c5d5a115dffc2 + // Leaf start - Async target finding + Llama llama = poll(); + double d = Double.MAX_VALUE; -+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.enabled) { ++ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchEntity) { + if (llama == null) { + findTargetAsync(); + return false; @@ -997,10 +1003,10 @@ index 6463c3c9b08d6058f2843c225b08a40fc30a960b..126bd98bc5980a2f1177bd7c74918b86 @Override public boolean canContinueToUse() { diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java -index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..efd999c235271ac6b0935933db939cad51691a42 100644 +index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..146a5efa6d4f978ee30a71a4a52340a8d470f590 100644 --- a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java +++ b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java -@@ -41,8 +41,60 @@ public abstract class MoveToBlockGoal extends Goal { +@@ -41,14 +41,67 @@ public abstract class MoveToBlockGoal extends Goal { this.setFlags(EnumSet.of(Goal.Flag.MOVE, Goal.Flag.JUMP)); } @@ -1048,6 +1054,7 @@ index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..efd999c235271ac6b0935933db939cad + Strider, + TurtleToWater, + TurtleLay, ++ Unknown, + } + // Leaf end - Async target finding + @@ -1061,24 +1068,43 @@ index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..efd999c235271ac6b0935933db939cad if (this.nextStartTick > 0) { this.nextStartTick--; return false; -@@ -109,6 +161,12 @@ public abstract class MoveToBlockGoal extends Goal { + } else { + this.nextStartTick = this.nextStartTick(this.mob); +- return this.findNearestBlock(); ++ return this.findNearestBlockAsync(); // Leaf - Async target finding + } } - protected boolean findNearestBlock() { -+ // Leaf start - Async target finding -+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchBlock) { -+ getBlockAsync(); -+ return false; -+ } -+ // Leaf end - Async target finding - int i = this.searchRange; - int i1 = this.verticalSearchRange; - BlockPos blockPos = this.mob.blockPosition(); -@@ -133,5 +191,105 @@ public abstract class MoveToBlockGoal extends Goal { +@@ -133,5 +186,133 @@ public abstract class MoveToBlockGoal extends Goal { return false; } + // Leaf start - Async target finding ++ protected boolean findNearestBlockAsync() { ++ if (!org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchBlock) { ++ return findNearestBlock(); ++ } ++ final var mob = this.mob; ++ final var ctx = mob.getGoalCtx(); ++ if (!ctx.state) return false; ++ final var serverLevel = getServerLevel(mob); ++ final TypeToCheck ty = this.typeToCheck(); ++ final net.minecraft.world.level.block.Block toRemove; ++ if (this instanceof RemoveBlockGoal removeBlockGoal) { ++ toRemove = removeBlockGoal.blockToRemove; ++ } else { ++ toRemove = null; ++ } ++ final int verticalSearchStart = this.verticalSearchStart; ++ final int searchRange = this.searchRange; ++ final int verticalSearchRange = this.verticalSearchRange; ++ final BlockPos blockPos = mob.blockPosition(); ++ final float restrictRadius = mob.getRestrictRadius(); ++ final BlockPos restrictCenter = mob.getRestrictCenter(); ++ ctx.wake = () -> findNearestBlockAsync(ty, toRemove, mob, serverLevel, verticalSearchStart, searchRange, verticalSearchRange, blockPos, restrictRadius, restrictCenter); ++ return false; ++ } ++ + protected static @javax.annotation.Nullable BlockPos findNearestBlockAsync( + final TypeToCheck ty, + @org.jetbrains.annotations.Nullable final net.minecraft.world.level.block.Block toRemove, @@ -1117,7 +1143,9 @@ index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..efd999c235271ac6b0935933db939cad protected abstract boolean isValidTarget(LevelReader level, BlockPos pos); + + // Leaf start - Async target finding -+ protected abstract TypeToCheck typeToCheck(); ++ protected TypeToCheck typeToCheck() { ++ return TypeToCheck.Unknown; ++ } + + private static boolean isValidTargetAsync( + TypeToCheck type, @@ -1175,6 +1203,7 @@ index 3f080b15543bf8c5fa0774b62d7f12e13b82511a..efd999c235271ac6b0935933db939cad + case TurtleLay -> { + return level.isEmptyBlock(pos.above()) && net.minecraft.world.level.block.TurtleEggBlock.isSand(level, pos); + } ++ case Unknown -> throw new IllegalStateException(); + case null -> throw new IllegalStateException(); + } + // Leaf end - Async target finding @@ -1244,10 +1273,10 @@ index 3c274d917bca9de87abfb842f5f332e112a7a2d7..a3f96a6dac65a315842a4ae5de6c5ea0 public boolean canContinueToUse() { return this.tick > 0; diff --git a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -index c67a88c9c77ece7c85ffb169ac96da4f28291228..a70fbb0f613befcba5daa961d941c6d40c3c356f 100644 +index c67a88c9c77ece7c85ffb169ac96da4f28291228..a1a967780f904e05cfc5d804ecd637aa60f44438 100644 --- a/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java +++ b/net/minecraft/world/entity/ai/goal/RemoveBlockGoal.java -@@ -37,7 +37,14 @@ public class RemoveBlockGoal extends MoveToBlockGoal { +@@ -37,10 +37,17 @@ public class RemoveBlockGoal extends MoveToBlockGoal { public boolean canUse() { if (!getServerLevel(this.removerMob).purpurConfig.zombieBypassMobGriefing == !getServerLevel(this.removerMob).getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING)) { // Purpur - Add mobGriefing bypass to everything affected return false; @@ -1262,7 +1291,11 @@ index c67a88c9c77ece7c85ffb169ac96da4f28291228..a70fbb0f613befcba5daa961d941c6d4 + if (this.nextStartTick > 0) { this.nextStartTick--; return false; - } else if (this.findNearestBlock()) { +- } else if (this.findNearestBlock()) { ++ } else if (this.findNearestBlockAsync()) { // Leaf - Async target finding + this.nextStartTick = reducedTickDelay(20); + return true; + } else { @@ -151,8 +158,15 @@ public class RemoveBlockGoal extends MoveToBlockGoal { protected boolean isValidTarget(LevelReader level, BlockPos pos) { ChunkAccess chunk = level.getChunkIfLoadedImmediately(pos.getX() >> 4, pos.getZ() >> 4); // Paper - Prevent AI rules from loading chunks @@ -1281,10 +1314,10 @@ index c67a88c9c77ece7c85ffb169ac96da4f28291228..a70fbb0f613befcba5daa961d941c6d4 + // Leaf end - Async target finding } diff --git a/net/minecraft/world/entity/ai/goal/TemptGoal.java b/net/minecraft/world/entity/ai/goal/TemptGoal.java -index f88f618d34fb343b31de3af1a875d6633703df71..4bbd83c702a818b48313698919dc9a85392707f6 100644 +index f88f618d34fb343b31de3af1a875d6633703df71..234b6e4712a289fd858e3bc2d79df897a28281f7 100644 --- a/net/minecraft/world/entity/ai/goal/TemptGoal.java +++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java -@@ -36,12 +36,51 @@ public class TemptGoal extends Goal { +@@ -36,12 +36,43 @@ public class TemptGoal extends Goal { this.targetingConditions = TEMPT_TARGETING.copy().selector((entity, level) -> this.shouldFollow(entity)); } @@ -1316,31 +1349,23 @@ index f88f618d34fb343b31de3af1a875d6633703df71..4bbd83c702a818b48313698919dc9a85 } else { + // Leaf start - Async target finding + if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchEntity) { -+ if (poll()) { -+ if (this.player != null) { -+ org.bukkit.event.entity.EntityTargetLivingEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTargetLivingEvent(this.mob, this.player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TEMPT); -+ if (event.isCancelled()) { -+ return false; -+ } -+ this.player = (event.getTarget() == null) ? null : ((org.bukkit.craftbukkit.entity.CraftLivingEntity) event.getTarget()).getHandle(); -+ } -+ if (this.player != null) { -+ return true; -+ } -+ } else { ++ if (!poll()) { + getNearestPlayerAsync(); + return false; + } ++ } else { ++ this.player = getServerLevel(this.mob) ++ .getNearestPlayer(this.targetingConditions.range(this.mob.getAttributeValue(Attributes.TEMPT_RANGE)), this.mob); + } + // Leaf end - Async target finding this.player = getServerLevel(this.mob) .getNearestPlayer(this.targetingConditions.range(this.mob.getAttributeValue(Attributes.TEMPT_RANGE)), this.mob); // CraftBukkit start diff --git a/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java b/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java -index 4644f3f7af89623ca6218c0dd24bb6cd67db553b..6f55599d206d8d6cdabe4e2a00dddb98448e498f 100644 +index 4644f3f7af89623ca6218c0dd24bb6cd67db553b..a5a09f33ff1d4dec3ab2ea9f0fd6da0da30d524d 100644 --- a/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java +++ b/net/minecraft/world/entity/ai/goal/target/DefendVillageTargetGoal.java -@@ -24,8 +24,49 @@ public class DefendVillageTargetGoal extends TargetGoal { +@@ -24,8 +24,47 @@ public class DefendVillageTargetGoal extends TargetGoal { this.setFlags(EnumSet.of(Goal.Flag.TARGET)); } @@ -1349,7 +1374,6 @@ index 4644f3f7af89623ca6218c0dd24bb6cd67db553b..6f55599d206d8d6cdabe4e2a00dddb98 + if (!(this.mob.getGoalCtx().result() instanceof LivingEntity target)) return false; + ServerLevel serverLevel = getServerLevel(this.mob); + if (serverLevel == null || !target.isAlive() || !attackTargeting.test(serverLevel, golem, target)) return false; -+ if ((target instanceof Player player && (player.isSpectator() || player.isCreative()))) return false; + this.potentialTarget = target; + return true; + } @@ -1379,19 +1403,21 @@ index 4644f3f7af89623ca6218c0dd24bb6cd67db553b..6f55599d206d8d6cdabe4e2a00dddb98 @Override public boolean canUse() { + // Leaf start - Async target finding -+ if (poll()) { -+ return true; -+ } + if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchEntity) { -+ this.findTargetAsync(); -+ return false; -+ } ++ if (!poll()) { ++ this.findTargetAsync(); ++ return false; ++ } ++ } else { + // Leaf end - Async target finding AABB aabb = this.golem.getBoundingBox().inflate(10.0, 8.0, 10.0); ServerLevel serverLevel = getServerLevel(this.golem); List nearbyEntities = serverLevel.getNearbyEntities(Villager.class, this.attackTargeting, this.golem, aabb); -@@ -43,7 +84,7 @@ public class DefendVillageTargetGoal extends TargetGoal { +@@ -41,9 +80,10 @@ public class DefendVillageTargetGoal extends TargetGoal { + } + } } ++ } // Leaf - Async target finding return this.potentialTarget != null - && (!(this.potentialTarget instanceof Player) || !this.potentialTarget.isSpectator() && !((Player)this.potentialTarget).isCreative()); @@ -1400,7 +1426,7 @@ index 4644f3f7af89623ca6218c0dd24bb6cd67db553b..6f55599d206d8d6cdabe4e2a00dddb98 @Override diff --git a/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java b/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java -index 25fe78116ce01eeefe5c958423734195d27302eb..b57f308963550584c73aaf8027061ac140a827a1 100644 +index 25fe78116ce01eeefe5c958423734195d27302eb..bfe73d837c346b7550da2a3f521c25390f9f9530 100644 --- a/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java +++ b/net/minecraft/world/entity/ai/goal/target/HurtByTargetGoal.java @@ -73,6 +73,46 @@ public class HurtByTargetGoal extends TargetGoal { @@ -1474,9 +1500,9 @@ index 25fe78116ce01eeefe5c958423734195d27302eb..b57f308963550584c73aaf8027061ac1 + // Leaf start - Async target finding + public void poll() { -+ if (!(this.mob.getGoalCtx().result() instanceof List toAlert)) return; ++ if (!(this.mob.getGoalCtx().result() instanceof List toAlert)) return; + LivingEntity lastHurtByMob = this.mob.getLastHurtByMob(); -+ if (lastHurtByMob.getType() == EntityType.PLAYER && getServerLevel(this.mob).getGameRules().getBoolean(GameRules.RULE_UNIVERSAL_ANGER)) { ++ if (lastHurtByMob == null || (lastHurtByMob.getType() == EntityType.PLAYER && getServerLevel(this.mob).getGameRules().getBoolean(GameRules.RULE_UNIVERSAL_ANGER))) { + return; + } + for (Class clazz : this.toIgnoreDamage) { @@ -1506,10 +1532,10 @@ index 25fe78116ce01eeefe5c958423734195d27302eb..b57f308963550584c73aaf8027061ac1 mob.setTarget(target, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_NEARBY_ENTITY, true); // CraftBukkit - reason } diff --git a/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java b/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java -index 85eae0a14f7a417dfd8c911079d05354a98e5834..0f20ad9dd776a057cf4a34fc9572181b0153b94f 100644 +index 85eae0a14f7a417dfd8c911079d05354a98e5834..4eb56c456f9b71b3d6d8f7d8e089d08ac68a236f 100644 --- a/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java +++ b/net/minecraft/world/entity/ai/goal/target/NearestAttackableTargetGoal.java -@@ -41,8 +41,43 @@ public class NearestAttackableTargetGoal extends TargetG +@@ -41,12 +41,54 @@ public class NearestAttackableTargetGoal extends TargetG this.targetConditions = TargetingConditions.forCombat().range(this.getFollowDistance()).selector(selector); } @@ -1522,7 +1548,14 @@ index 85eae0a14f7a417dfd8c911079d05354a98e5834..0f20ad9dd776a057cf4a34fc9572181b + return true; + } + -+ private void findTargetAsync() { ++ protected void findTargetAsync() { ++ // Leaf start - Async target finding ++ if (!org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchEntity) { ++ this.findTarget(); ++ return; ++ } ++ this.target = null; ++ // Leaf end - Async target finding + final Mob mob = this.mob; + final var ctx = mob.getGoalCtx(); + if (!ctx.state) return; @@ -1553,27 +1586,24 @@ index 85eae0a14f7a417dfd8c911079d05354a98e5834..0f20ad9dd776a057cf4a34fc9572181b if (this.randomInterval > 0 && this.mob.getRandom().nextInt(this.randomInterval) != 0) { return false; } else { -@@ -57,6 +92,15 @@ public class NearestAttackableTargetGoal extends TargetG +- this.findTarget(); ++ this.findTargetAsync(); // Leaf - Async target finding + return this.target != null; + } + } +@@ -57,6 +99,7 @@ public class NearestAttackableTargetGoal extends TargetG protected void findTarget() { ServerLevel serverLevel = getServerLevel(this.mob); -+ -+ // Leaf start - Async target finding -+ if (org.dreeam.leaf.config.modules.async.AsyncTargetFinding.searchEntity) { -+ this.findTargetAsync(); -+ this.target = null; -+ return; -+ } -+ // Leaf end - Async target finding + if (this.targetType != Player.class && this.targetType != ServerPlayer.class) { this.target = serverLevel.getNearestEntity( this.mob.level().getEntitiesOfClass(this.targetType, this.getTargetSearchArea(this.getFollowDistance()), entity -> true), diff --git a/net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java b/net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java -index 4604a603c4ddd0a9242e859aaa5a511c2d4c4f84..7274dfb52ca4a08cdebcd04294cedc73460593e5 100644 +index 4604a603c4ddd0a9242e859aaa5a511c2d4c4f84..84c7b89e7c894c0f544cf0ffcf9dff3f6a5919cc 100644 --- a/net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java +++ b/net/minecraft/world/entity/ai/goal/target/NearestHealableRaiderTargetGoal.java -@@ -23,7 +23,15 @@ public class NearestHealableRaiderTargetGoal extends Nea +@@ -23,12 +23,20 @@ public class NearestHealableRaiderTargetGoal extends Nea @Override public boolean canUse() { @@ -1590,6 +1620,12 @@ index 4604a603c4ddd0a9242e859aaa5a511c2d4c4f84..7274dfb52ca4a08cdebcd04294cedc73 return false; } else if (!((Raider)this.mob).hasActiveRaid()) { return false; + } else { +- this.findTarget(); ++ this.findTargetAsync(); // Leaf - Async target finding + return this.target != null; + } + } diff --git a/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java b/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java index abf57494950f55bbd75f335f26736cb9e703c197..efd2418f56c36e7850edde483a2a4906dd622441 100644 --- a/net/minecraft/world/entity/ai/goal/target/NonTameRandomTargetGoal.java @@ -1954,7 +1990,7 @@ index ae4ee948971e931e4fdc4ec2187f5182195c626c..041079bf35822e75b5464a6336f517b3 static class StriderPathNavigation extends GroundPathNavigation { diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index ac7729d1caa80155697bfe0e8646e4eda5d1780e..c8872d7b8dbf368f401b6c36b8145c1d53ece0dd 100644 +index 41b67fda739ca98383f9f795d97b01969e85e609..f679ed1fb96e135b044359e55d69bfa803a6b215 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -1817,9 +1817,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl diff --git a/leaf-server/minecraft-patches/features/0150-Optimize-ThreadedTicketLevelPropagator.patch b/leaf-server/minecraft-patches/features/0148-Optimize-ThreadedTicketLevelPropagator.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0150-Optimize-ThreadedTicketLevelPropagator.patch rename to leaf-server/minecraft-patches/features/0148-Optimize-ThreadedTicketLevelPropagator.patch diff --git a/leaf-server/minecraft-patches/features/0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch b/leaf-server/minecraft-patches/features/0149-Optimise-MobEffectUtil-getDigSpeedAmplification.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0151-Optimise-MobEffectUtil-getDigSpeedAmplification.patch rename to leaf-server/minecraft-patches/features/0149-Optimise-MobEffectUtil-getDigSpeedAmplification.patch diff --git a/leaf-server/minecraft-patches/features/0152-Optimise-chunkUnloads.patch b/leaf-server/minecraft-patches/features/0150-Optimise-chunkUnloads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0152-Optimise-chunkUnloads.patch rename to leaf-server/minecraft-patches/features/0150-Optimise-chunkUnloads.patch diff --git a/leaf-server/minecraft-patches/features/0153-Optimize-BlockEntityType-isValid.patch b/leaf-server/minecraft-patches/features/0151-Optimize-BlockEntityType-isValid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0153-Optimize-BlockEntityType-isValid.patch rename to leaf-server/minecraft-patches/features/0151-Optimize-BlockEntityType-isValid.patch diff --git a/leaf-server/minecraft-patches/features/0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch b/leaf-server/minecraft-patches/features/0152-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0154-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch rename to leaf-server/minecraft-patches/features/0152-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch diff --git a/leaf-server/minecraft-patches/features/0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch b/leaf-server/minecraft-patches/features/0153-PaperPR-Fix-save-load-NaN-Entity-Motion.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0155-PaperPR-Fix-save-load-NaN-Entity-Motion.patch rename to leaf-server/minecraft-patches/features/0153-PaperPR-Fix-save-load-NaN-Entity-Motion.patch diff --git a/leaf-server/minecraft-patches/features/0156-PaperPR-Fix-unnecessary-map-data-saves.patch b/leaf-server/minecraft-patches/features/0154-PaperPR-Fix-unnecessary-map-data-saves.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0156-PaperPR-Fix-unnecessary-map-data-saves.patch rename to leaf-server/minecraft-patches/features/0154-PaperPR-Fix-unnecessary-map-data-saves.patch diff --git a/leaf-server/minecraft-patches/features/0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch b/leaf-server/minecraft-patches/features/0155-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0157-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch rename to leaf-server/minecraft-patches/features/0155-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch diff --git a/leaf-server/minecraft-patches/features/0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch b/leaf-server/minecraft-patches/features/0156-Sakura-copy-EntityList-implementation-to-BasicEntity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0158-Sakura-copy-EntityList-implementation-to-BasicEntity.patch rename to leaf-server/minecraft-patches/features/0156-Sakura-copy-EntityList-implementation-to-BasicEntity.patch diff --git a/leaf-server/minecraft-patches/features/0159-Protocol-Core.patch b/leaf-server/minecraft-patches/features/0157-Protocol-Core.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0159-Protocol-Core.patch rename to leaf-server/minecraft-patches/features/0157-Protocol-Core.patch diff --git a/leaf-server/minecraft-patches/features/0160-Reduce-PlayerChunk-Updates.patch b/leaf-server/minecraft-patches/features/0158-Reduce-PlayerChunk-Updates.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0160-Reduce-PlayerChunk-Updates.patch rename to leaf-server/minecraft-patches/features/0158-Reduce-PlayerChunk-Updates.patch diff --git a/leaf-server/minecraft-patches/features/0161-Async-switch-connection-state.patch b/leaf-server/minecraft-patches/features/0159-Async-switch-connection-state.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0161-Async-switch-connection-state.patch rename to leaf-server/minecraft-patches/features/0159-Async-switch-connection-state.patch diff --git a/leaf-server/minecraft-patches/features/0162-Optimize-BlockEntities-tickersInLevel.patch b/leaf-server/minecraft-patches/features/0160-Optimize-BlockEntities-tickersInLevel.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0162-Optimize-BlockEntities-tickersInLevel.patch rename to leaf-server/minecraft-patches/features/0160-Optimize-BlockEntities-tickersInLevel.patch diff --git a/leaf-server/minecraft-patches/features/0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch b/leaf-server/minecraft-patches/features/0161-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0163-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch rename to leaf-server/minecraft-patches/features/0161-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch diff --git a/leaf-server/minecraft-patches/features/0164-Flush-location-while-knockback.patch b/leaf-server/minecraft-patches/features/0162-Flush-location-while-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0164-Flush-location-while-knockback.patch rename to leaf-server/minecraft-patches/features/0162-Flush-location-while-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0165-Only-tick-items-at-hand.patch b/leaf-server/minecraft-patches/features/0163-Only-tick-items-at-hand.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0165-Only-tick-items-at-hand.patch rename to leaf-server/minecraft-patches/features/0163-Only-tick-items-at-hand.patch diff --git a/leaf-server/minecraft-patches/features/0166-Smart-sort-items-in-NearestItemSensor.patch b/leaf-server/minecraft-patches/features/0164-Smart-sort-items-in-NearestItemSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0166-Smart-sort-items-in-NearestItemSensor.patch rename to leaf-server/minecraft-patches/features/0164-Smart-sort-items-in-NearestItemSensor.patch diff --git a/leaf-server/minecraft-patches/features/0167-Optimise-player-movement-checks.patch b/leaf-server/minecraft-patches/features/0165-Optimise-player-movement-checks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0167-Optimise-player-movement-checks.patch rename to leaf-server/minecraft-patches/features/0165-Optimise-player-movement-checks.patch diff --git a/leaf-server/minecraft-patches/features/0168-Remove-streams-in-MobSensor.patch b/leaf-server/minecraft-patches/features/0166-Remove-streams-in-MobSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0168-Remove-streams-in-MobSensor.patch rename to leaf-server/minecraft-patches/features/0166-Remove-streams-in-MobSensor.patch diff --git a/leaf-server/minecraft-patches/features/0169-Remove-streams-in-TemptingSensor.patch b/leaf-server/minecraft-patches/features/0167-Remove-streams-in-TemptingSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0169-Remove-streams-in-TemptingSensor.patch rename to leaf-server/minecraft-patches/features/0167-Remove-streams-in-TemptingSensor.patch diff --git a/leaf-server/minecraft-patches/features/0170-Use-HashedList-on-WeightedRandomList.patch b/leaf-server/minecraft-patches/features/0168-Use-HashedList-on-WeightedRandomList.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0170-Use-HashedList-on-WeightedRandomList.patch rename to leaf-server/minecraft-patches/features/0168-Use-HashedList-on-WeightedRandomList.patch diff --git a/leaf-server/minecraft-patches/features/0171-Add-configurable-death-item-drop-knockback-settings.patch b/leaf-server/minecraft-patches/features/0169-Add-configurable-death-item-drop-knockback-settings.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0171-Add-configurable-death-item-drop-knockback-settings.patch rename to leaf-server/minecraft-patches/features/0169-Add-configurable-death-item-drop-knockback-settings.patch diff --git a/leaf-server/minecraft-patches/features/0172-Optimize-getScaledTrackingDistance.patch b/leaf-server/minecraft-patches/features/0170-Optimize-getScaledTrackingDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0172-Optimize-getScaledTrackingDistance.patch rename to leaf-server/minecraft-patches/features/0170-Optimize-getScaledTrackingDistance.patch diff --git a/leaf-server/minecraft-patches/features/0173-Optimize-SynchedEntityData-packDirty.patch b/leaf-server/minecraft-patches/features/0171-Optimize-SynchedEntityData-packDirty.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0173-Optimize-SynchedEntityData-packDirty.patch rename to leaf-server/minecraft-patches/features/0171-Optimize-SynchedEntityData-packDirty.patch diff --git a/leaf-server/minecraft-patches/features/0174-Optimize-isEyeInFluid.patch b/leaf-server/minecraft-patches/features/0172-Optimize-isEyeInFluid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0174-Optimize-isEyeInFluid.patch rename to leaf-server/minecraft-patches/features/0172-Optimize-isEyeInFluid.patch diff --git a/leaf-server/minecraft-patches/features/0175-Cache-block-path-type.patch b/leaf-server/minecraft-patches/features/0173-Cache-block-path-type.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0175-Cache-block-path-type.patch rename to leaf-server/minecraft-patches/features/0173-Cache-block-path-type.patch diff --git a/leaf-server/minecraft-patches/features/0176-optimize-getEntityStatus.patch b/leaf-server/minecraft-patches/features/0174-optimize-getEntityStatus.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0176-optimize-getEntityStatus.patch rename to leaf-server/minecraft-patches/features/0174-optimize-getEntityStatus.patch diff --git a/leaf-server/minecraft-patches/features/0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch b/leaf-server/minecraft-patches/features/0175-Rail-Optimization-optimized-PoweredRailBlock-logic.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0177-Rail-Optimization-optimized-PoweredRailBlock-logic.patch rename to leaf-server/minecraft-patches/features/0175-Rail-Optimization-optimized-PoweredRailBlock-logic.patch diff --git a/leaf-server/minecraft-patches/features/0178-optimise-ChunkGenerator-getMobsAt.patch b/leaf-server/minecraft-patches/features/0176-optimise-ChunkGenerator-getMobsAt.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0178-optimise-ChunkGenerator-getMobsAt.patch rename to leaf-server/minecraft-patches/features/0176-optimise-ChunkGenerator-getMobsAt.patch diff --git a/leaf-server/minecraft-patches/features/0179-optimise-getBiome.patch b/leaf-server/minecraft-patches/features/0177-optimise-getBiome.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0179-optimise-getBiome.patch rename to leaf-server/minecraft-patches/features/0177-optimise-getBiome.patch diff --git a/leaf-server/minecraft-patches/features/0180-optimize-mob-spawning.patch b/leaf-server/minecraft-patches/features/0178-optimize-mob-spawning.patch similarity index 98% rename from leaf-server/minecraft-patches/features/0180-optimize-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0178-optimize-mob-spawning.patch index d606a09a..8386d6a8 100644 --- a/leaf-server/minecraft-patches/features/0180-optimize-mob-spawning.patch +++ b/leaf-server/minecraft-patches/features/0178-optimize-mob-spawning.patch @@ -5,7 +5,7 @@ Subject: [PATCH] optimize mob spawning diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index f57f8e610dac80b8095bfc0c7e4b22ff5ad6b13c..c1efd558cfbfd2200295ef5755aa496e95deb7d7 100644 +index 52a2b993bbd1ad4851b3273af6ecbc069beb5b84..05df09d5f586c90f3169ddf1fa73a1d3fd734b73 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java @@ -70,7 +70,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon @@ -19,7 +19,7 @@ index f57f8e610dac80b8095bfc0c7e4b22ff5ad6b13c..c1efd558cfbfd2200295ef5755aa496e // Paper start public final ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable fullChunks = new ca.spottedleaf.concurrentutil.map.ConcurrentLong2ReferenceChainedHashTable<>(); public int getFullChunksCount() { -@@ -655,13 +657,37 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -658,13 +660,37 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon filteredSpawningCategories = List.of(); } diff --git a/leaf-server/minecraft-patches/features/0181-optimize-structure-map.patch b/leaf-server/minecraft-patches/features/0179-optimize-structure-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0181-optimize-structure-map.patch rename to leaf-server/minecraft-patches/features/0179-optimize-structure-map.patch diff --git a/leaf-server/minecraft-patches/features/0182-throttle-mob-spawning.patch b/leaf-server/minecraft-patches/features/0180-throttle-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0182-throttle-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0180-throttle-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0183-Add-BlockExplosionHitEvent.patch b/leaf-server/minecraft-patches/features/0181-Add-BlockExplosionHitEvent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0183-Add-BlockExplosionHitEvent.patch rename to leaf-server/minecraft-patches/features/0181-Add-BlockExplosionHitEvent.patch diff --git a/leaf-server/minecraft-patches/features/0184-Old-Blast-Protection-explosion-knockback.patch b/leaf-server/minecraft-patches/features/0182-Old-Blast-Protection-explosion-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0184-Old-Blast-Protection-explosion-knockback.patch rename to leaf-server/minecraft-patches/features/0182-Old-Blast-Protection-explosion-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0183-Use-UUID-for-cure-reputation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0185-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0183-Use-UUID-for-cure-reputation.patch diff --git a/leaf-server/minecraft-patches/features/0186-Cache-potential-behaviors-in-Brain.patch b/leaf-server/minecraft-patches/features/0184-Cache-potential-behaviors-in-Brain.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0186-Cache-potential-behaviors-in-Brain.patch rename to leaf-server/minecraft-patches/features/0184-Cache-potential-behaviors-in-Brain.patch diff --git a/leaf-server/minecraft-patches/features/0187-Use-ActivationList-on-runningBehaviors.patch b/leaf-server/minecraft-patches/features/0185-Use-ActivationList-on-runningBehaviors.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0187-Use-ActivationList-on-runningBehaviors.patch rename to leaf-server/minecraft-patches/features/0185-Use-ActivationList-on-runningBehaviors.patch diff --git a/leaf-server/minecraft-patches/features/0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch b/leaf-server/minecraft-patches/features/0186-Paper-Fix-infinite-loop-in-RegionFile-IO.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0188-Paper-Fix-infinite-loop-in-RegionFile-IO.patch rename to leaf-server/minecraft-patches/features/0186-Paper-Fix-infinite-loop-in-RegionFile-IO.patch diff --git a/leaf-server/minecraft-patches/features/0189-Paper-Fix-excess-slot-updates.patch b/leaf-server/minecraft-patches/features/0187-Paper-Fix-excess-slot-updates.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0189-Paper-Fix-excess-slot-updates.patch rename to leaf-server/minecraft-patches/features/0187-Paper-Fix-excess-slot-updates.patch index cce1462f..be60c9f6 100644 --- a/leaf-server/minecraft-patches/features/0189-Paper-Fix-excess-slot-updates.patch +++ b/leaf-server/minecraft-patches/features/0187-Paper-Fix-excess-slot-updates.patch @@ -10,7 +10,7 @@ Paper pull request: https://github.com/PaperMC/Paper/pull/12654 https://github.com/PaperMC/Paper/commit/e714de636543d61fcd3682705484c8a15f4f3ca6 diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java -index ff2ff95ec9d94e2e31e8174196b384c37d56f38a..3ffc454609adc82c6a4daba68efac129bee38eb5 100644 +index ff2ff95ec9d94e2e31e8174196b384c37d56f38a..59ab331604096427fd0c2bbe920782c291363f3a 100644 --- a/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -553,7 +553,7 @@ public abstract class AbstractContainerMenu { diff --git a/leaf-server/minecraft-patches/features/0190-Fix-crash-during-parsing-unknown-command-message.patch b/leaf-server/minecraft-patches/features/0188-Fix-crash-during-parsing-unknown-command-message.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0190-Fix-crash-during-parsing-unknown-command-message.patch rename to leaf-server/minecraft-patches/features/0188-Fix-crash-during-parsing-unknown-command-message.patch diff --git a/leaf-server/minecraft-patches/features/0191-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0189-Paw-optimization.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0191-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0189-Paw-optimization.patch index 91d9e5fb..53c9fdec 100644 --- a/leaf-server/minecraft-patches/features/0191-Paw-optimization.patch +++ b/leaf-server/minecraft-patches/features/0189-Paw-optimization.patch @@ -100,7 +100,7 @@ index 4535858701b2bb232b9d2feb2af6551526232ddc..e65c62dbe4c1560ae153e4c4344e9194 - // Paper end - detailed watchdog information } diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index c1efd558cfbfd2200295ef5755aa496e95deb7d7..15bbd1f7f2a90b4b5427026d622764bb1c92d465 100644 +index 05df09d5f586c90f3169ddf1fa73a1d3fd734b73..fbcff9a0e4aa68375e7ebcc297ba4a7bf089c4f3 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java @@ -506,9 +506,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon diff --git a/leaf-server/minecraft-patches/features/0192-optimize-random-tick.patch b/leaf-server/minecraft-patches/features/0190-optimize-random-tick.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0192-optimize-random-tick.patch rename to leaf-server/minecraft-patches/features/0190-optimize-random-tick.patch index 76b1f5a9..0f3e4703 100644 --- a/leaf-server/minecraft-patches/features/0192-optimize-random-tick.patch +++ b/leaf-server/minecraft-patches/features/0190-optimize-random-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] optimize random tick diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index c80e6669013d3cf87b51d0cb0b62fcf5466d702c..9d132c88629976cc00d470980308571ac3222284 100644 +index fbcff9a0e4aa68375e7ebcc297ba4a7bf089c4f3..e07fdd22e08cb4e30cf606c055e85b5946e8c046 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -693,6 +693,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -696,6 +696,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.level.tickChunk(levelChunk, _int); } }