diff --git a/leaf-server/minecraft-patches/features/0120-Alternative-Brain-Behaviour.patch b/leaf-server/minecraft-patches/features/0120-Alternative-Brain-Behaviour.patch deleted file mode 100644 index b6b27059..00000000 --- a/leaf-server/minecraft-patches/features/0120-Alternative-Brain-Behaviour.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Taiyou06 -Date: Fri, 14 Feb 2025 14:58:59 +0100 -Subject: [PATCH] Alternative Brain Behaviour - -In the test, this can give ~54.87% improvement (~25712ms -> ~11604ms), -under 1024 villagers situation. - -diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index e27284f9897923f67985e3d60c3438bd00cc4a51..0ff7564e0e848bd38e82f9089bfd7249fa649dc5 100644 ---- a/net/minecraft/world/entity/ai/Brain.java -+++ b/net/minecraft/world/entity/ai/Brain.java -@@ -268,23 +268,52 @@ public class Brain { - return this.activeActivities; - } - -+ // Leaf start - Alternative Brain Behaviour -+ private ObjectArrayList> runningBehaviorsCache; -+ private long lastRunningBehaviorCheck = -1; -+ // Leaf end - Alternative Brain Behaviour -+ - @Deprecated - @VisibleForDebug - public List> getRunningBehaviors() { -- List> list = new ObjectArrayList<>(); -+ // Leaf start - Alternative Brain Behaviour -+ long currentTick = getCurrentTick(); -+ -+ // Use cached result if within update interval -+ if (runningBehaviorsCache != null && (currentTick - lastRunningBehaviorCheck) < org.dreeam.leaf.config.modules.opt.BrainRunningBehaviorCacheUpdate.interval) { -+ return runningBehaviorsCache; -+ } -+ -+ // Initialize or reuse cache list -+ if (runningBehaviorsCache == null) { -+ runningBehaviorsCache = new ObjectArrayList<>(32); -+ } else { -+ runningBehaviorsCache.clear(); -+ } -+ -+ for (Map>> activityMap : availableBehaviorsByPriority.values()) { -+ for (Set> behaviors : activityMap.values()) { -+ if (behaviors.isEmpty()) continue; - -- for (Map>> map : this.availableBehaviorsByPriority.values()) { -- for (Set> set : map.values()) { -- for (BehaviorControl behaviorControl : set) { -- if (behaviorControl.getStatus() == Behavior.Status.RUNNING) { -- list.add(behaviorControl); -+ for (BehaviorControl behavior : behaviors) { -+ if (behavior.getStatus() == Behavior.Status.RUNNING) { -+ runningBehaviorsCache.add(behavior); - } - } - } - } - -- return list; -+ lastRunningBehaviorCheck = currentTick; -+ -+ return runningBehaviorsCache; -+ } -+ -+ // Helper method to get current tick -+ private long getCurrentTick() { -+ // This should be implemented to return the current game tick -+ return System.nanoTime() / 50_000_000; // Approximate tick time of 50ms - } -+ // Leaf end - Alternative Brain Behaviour - - public void useDefaultActivity() { - this.setActiveActivity(this.defaultActivity); diff --git a/leaf-server/minecraft-patches/features/0121-Cache-eligible-players-for-despawn-checks.patch b/leaf-server/minecraft-patches/features/0120-Cache-eligible-players-for-despawn-checks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0121-Cache-eligible-players-for-despawn-checks.patch rename to leaf-server/minecraft-patches/features/0120-Cache-eligible-players-for-despawn-checks.patch diff --git a/leaf-server/minecraft-patches/features/0122-Slightly-optimise-getNearestPlayer.patch b/leaf-server/minecraft-patches/features/0121-Slightly-optimise-getNearestPlayer.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0122-Slightly-optimise-getNearestPlayer.patch rename to leaf-server/minecraft-patches/features/0121-Slightly-optimise-getNearestPlayer.patch diff --git a/leaf-server/minecraft-patches/features/0123-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch b/leaf-server/minecraft-patches/features/0122-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0123-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch rename to leaf-server/minecraft-patches/features/0122-Use-ensureCapacity-to-pre-populate-the-size-of-ticki.patch diff --git a/leaf-server/minecraft-patches/features/0124-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch b/leaf-server/minecraft-patches/features/0123-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0124-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch rename to leaf-server/minecraft-patches/features/0123-Directly-use-the-pre-filtered-ticking-chunks-list-as.patch diff --git a/leaf-server/minecraft-patches/features/0125-Bulk-writes-to-writeLongArray-during-chunk-loading.patch b/leaf-server/minecraft-patches/features/0124-Bulk-writes-to-writeLongArray-during-chunk-loading.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0125-Bulk-writes-to-writeLongArray-during-chunk-loading.patch rename to leaf-server/minecraft-patches/features/0124-Bulk-writes-to-writeLongArray-during-chunk-loading.patch diff --git a/leaf-server/minecraft-patches/features/0126-Improve-sorting-in-SortedArraySet.patch b/leaf-server/minecraft-patches/features/0125-Improve-sorting-in-SortedArraySet.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0126-Improve-sorting-in-SortedArraySet.patch rename to leaf-server/minecraft-patches/features/0125-Improve-sorting-in-SortedArraySet.patch diff --git a/leaf-server/minecraft-patches/features/0127-Make-removeIf-slightly-faster.patch b/leaf-server/minecraft-patches/features/0126-Make-removeIf-slightly-faster.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0127-Make-removeIf-slightly-faster.patch rename to leaf-server/minecraft-patches/features/0126-Make-removeIf-slightly-faster.patch diff --git a/leaf-server/minecraft-patches/features/0128-Optimize-LinearPalette.patch b/leaf-server/minecraft-patches/features/0127-Optimize-LinearPalette.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0128-Optimize-LinearPalette.patch rename to leaf-server/minecraft-patches/features/0127-Optimize-LinearPalette.patch diff --git a/leaf-server/minecraft-patches/features/0129-Slightly-optimized-VarInt-write.patch b/leaf-server/minecraft-patches/features/0128-Slightly-optimized-VarInt-write.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0129-Slightly-optimized-VarInt-write.patch rename to leaf-server/minecraft-patches/features/0128-Slightly-optimized-VarInt-write.patch diff --git a/leaf-server/minecraft-patches/features/0130-Rewrite-ClientboundLightUpdatePacketData.patch b/leaf-server/minecraft-patches/features/0129-Rewrite-ClientboundLightUpdatePacketData.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0130-Rewrite-ClientboundLightUpdatePacketData.patch rename to leaf-server/minecraft-patches/features/0129-Rewrite-ClientboundLightUpdatePacketData.patch diff --git a/leaf-server/minecraft-patches/features/0131-Async-chunk-send.patch b/leaf-server/minecraft-patches/features/0130-Async-chunk-send.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0131-Async-chunk-send.patch rename to leaf-server/minecraft-patches/features/0130-Async-chunk-send.patch diff --git a/leaf-server/minecraft-patches/features/0132-Spawner-Configurations.patch b/leaf-server/minecraft-patches/features/0131-Spawner-Configurations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0132-Spawner-Configurations.patch rename to leaf-server/minecraft-patches/features/0131-Spawner-Configurations.patch diff --git a/leaf-server/minecraft-patches/features/0133-SparklyPaper-Parallel-world-ticking.patch b/leaf-server/minecraft-patches/features/0132-SparklyPaper-Parallel-world-ticking.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0133-SparklyPaper-Parallel-world-ticking.patch rename to leaf-server/minecraft-patches/features/0132-SparklyPaper-Parallel-world-ticking.patch diff --git a/leaf-server/minecraft-patches/features/0134-SparklyPaper-Track-each-world-MSPT.patch b/leaf-server/minecraft-patches/features/0133-SparklyPaper-Track-each-world-MSPT.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0134-SparklyPaper-Track-each-world-MSPT.patch rename to leaf-server/minecraft-patches/features/0133-SparklyPaper-Track-each-world-MSPT.patch diff --git a/leaf-server/minecraft-patches/features/0135-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch b/leaf-server/minecraft-patches/features/0134-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0135-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch rename to leaf-server/minecraft-patches/features/0134-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch diff --git a/leaf-server/minecraft-patches/features/0136-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch b/leaf-server/minecraft-patches/features/0135-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0136-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch rename to leaf-server/minecraft-patches/features/0135-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch diff --git a/leaf-server/minecraft-patches/features/0137-Remove-streams-on-InsideBrownianWalk.patch b/leaf-server/minecraft-patches/features/0136-Remove-streams-on-InsideBrownianWalk.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0137-Remove-streams-on-InsideBrownianWalk.patch rename to leaf-server/minecraft-patches/features/0136-Remove-streams-on-InsideBrownianWalk.patch diff --git a/leaf-server/minecraft-patches/features/0138-Use-BFS-on-getSlopeDistance.patch b/leaf-server/minecraft-patches/features/0137-Use-BFS-on-getSlopeDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0138-Use-BFS-on-getSlopeDistance.patch rename to leaf-server/minecraft-patches/features/0137-Use-BFS-on-getSlopeDistance.patch diff --git a/leaf-server/minecraft-patches/features/0139-Paper-PR-Throttle-failed-spawn-attempts.patch b/leaf-server/minecraft-patches/features/0138-Paper-PR-Throttle-failed-spawn-attempts.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0139-Paper-PR-Throttle-failed-spawn-attempts.patch rename to leaf-server/minecraft-patches/features/0138-Paper-PR-Throttle-failed-spawn-attempts.patch diff --git a/leaf-server/minecraft-patches/features/0140-Improve-BlockEntity-ticking-isRemoved-check.patch b/leaf-server/minecraft-patches/features/0139-Improve-BlockEntity-ticking-isRemoved-check.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0140-Improve-BlockEntity-ticking-isRemoved-check.patch rename to leaf-server/minecraft-patches/features/0139-Improve-BlockEntity-ticking-isRemoved-check.patch diff --git a/leaf-server/minecraft-patches/features/0141-Raytrace-AntiXray-SDK-integration.patch b/leaf-server/minecraft-patches/features/0140-Raytrace-AntiXray-SDK-integration.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0141-Raytrace-AntiXray-SDK-integration.patch rename to leaf-server/minecraft-patches/features/0140-Raytrace-AntiXray-SDK-integration.patch diff --git a/leaf-server/minecraft-patches/features/0142-Optimize-addOrUpdateTransientModifier.patch b/leaf-server/minecraft-patches/features/0141-Optimize-addOrUpdateTransientModifier.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0142-Optimize-addOrUpdateTransientModifier.patch rename to leaf-server/minecraft-patches/features/0141-Optimize-addOrUpdateTransientModifier.patch diff --git a/leaf-server/minecraft-patches/features/0143-Optimize-ContextMap.create.patch b/leaf-server/minecraft-patches/features/0142-Optimize-ContextMap.create.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0143-Optimize-ContextMap.create.patch rename to leaf-server/minecraft-patches/features/0142-Optimize-ContextMap.create.patch diff --git a/leaf-server/minecraft-patches/features/0144-Micro-optimizations-for-random-tick.patch b/leaf-server/minecraft-patches/features/0143-Micro-optimizations-for-random-tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0144-Micro-optimizations-for-random-tick.patch rename to leaf-server/minecraft-patches/features/0143-Micro-optimizations-for-random-tick.patch diff --git a/leaf-server/minecraft-patches/features/0145-Remove-streams-on-updateConnectedPlayersWithinRange.patch b/leaf-server/minecraft-patches/features/0144-Remove-streams-on-updateConnectedPlayersWithinRange.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0145-Remove-streams-on-updateConnectedPlayersWithinRange.patch rename to leaf-server/minecraft-patches/features/0144-Remove-streams-on-updateConnectedPlayersWithinRange.patch diff --git a/leaf-server/minecraft-patches/features/0146-Remove-streams-on-PlayerDetector.patch b/leaf-server/minecraft-patches/features/0145-Remove-streams-on-PlayerDetector.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0146-Remove-streams-on-PlayerDetector.patch rename to leaf-server/minecraft-patches/features/0145-Remove-streams-on-PlayerDetector.patch diff --git a/leaf-server/minecraft-patches/features/0147-Use-direct-iteration-on-Sensing.tick.patch b/leaf-server/minecraft-patches/features/0146-Use-direct-iteration-on-Sensing.tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0147-Use-direct-iteration-on-Sensing.tick.patch rename to leaf-server/minecraft-patches/features/0146-Use-direct-iteration-on-Sensing.tick.patch diff --git a/leaf-server/minecraft-patches/features/0148-Optimise-non-flush-packet-sending.patch b/leaf-server/minecraft-patches/features/0147-Optimise-non-flush-packet-sending.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0148-Optimise-non-flush-packet-sending.patch rename to leaf-server/minecraft-patches/features/0147-Optimise-non-flush-packet-sending.patch diff --git a/leaf-server/minecraft-patches/features/0149-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch b/leaf-server/minecraft-patches/features/0148-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0149-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch rename to leaf-server/minecraft-patches/features/0148-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch diff --git a/leaf-server/minecraft-patches/features/0150-Null-handling-on-MultifaceSpreader.patch b/leaf-server/minecraft-patches/features/0149-Null-handling-on-MultifaceSpreader.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0150-Null-handling-on-MultifaceSpreader.patch rename to leaf-server/minecraft-patches/features/0149-Null-handling-on-MultifaceSpreader.patch diff --git a/leaf-server/minecraft-patches/features/0151-More-virtual-threads.patch b/leaf-server/minecraft-patches/features/0150-More-virtual-threads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0151-More-virtual-threads.patch rename to leaf-server/minecraft-patches/features/0150-More-virtual-threads.patch diff --git a/leaf-server/minecraft-patches/features/0152-Async-target-finding.patch b/leaf-server/minecraft-patches/features/0151-Async-target-finding.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0152-Async-target-finding.patch rename to leaf-server/minecraft-patches/features/0151-Async-target-finding.patch diff --git a/leaf-server/minecraft-patches/features/0153-Optimize-ThreadedTicketLevelPropagator.patch b/leaf-server/minecraft-patches/features/0152-Optimize-ThreadedTicketLevelPropagator.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0153-Optimize-ThreadedTicketLevelPropagator.patch rename to leaf-server/minecraft-patches/features/0152-Optimize-ThreadedTicketLevelPropagator.patch diff --git a/leaf-server/minecraft-patches/features/0154-Optimise-MobEffectUtil-getDigSpeedAmplification.patch b/leaf-server/minecraft-patches/features/0153-Optimise-MobEffectUtil-getDigSpeedAmplification.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0154-Optimise-MobEffectUtil-getDigSpeedAmplification.patch rename to leaf-server/minecraft-patches/features/0153-Optimise-MobEffectUtil-getDigSpeedAmplification.patch diff --git a/leaf-server/minecraft-patches/features/0155-Optimise-chunkUnloads.patch b/leaf-server/minecraft-patches/features/0154-Optimise-chunkUnloads.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0155-Optimise-chunkUnloads.patch rename to leaf-server/minecraft-patches/features/0154-Optimise-chunkUnloads.patch diff --git a/leaf-server/minecraft-patches/features/0156-Optimize-BlockEntityType-isValid.patch b/leaf-server/minecraft-patches/features/0155-Optimize-BlockEntityType-isValid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0156-Optimize-BlockEntityType-isValid.patch rename to leaf-server/minecraft-patches/features/0155-Optimize-BlockEntityType-isValid.patch diff --git a/leaf-server/minecraft-patches/features/0157-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch b/leaf-server/minecraft-patches/features/0156-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0157-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch rename to leaf-server/minecraft-patches/features/0156-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch diff --git a/leaf-server/minecraft-patches/features/0158-PaperPR-Fix-save-load-NaN-Entity-Motion.patch b/leaf-server/minecraft-patches/features/0157-PaperPR-Fix-save-load-NaN-Entity-Motion.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0158-PaperPR-Fix-save-load-NaN-Entity-Motion.patch rename to leaf-server/minecraft-patches/features/0157-PaperPR-Fix-save-load-NaN-Entity-Motion.patch diff --git a/leaf-server/minecraft-patches/features/0159-PaperPR-Fix-unnecessary-map-data-saves.patch b/leaf-server/minecraft-patches/features/0158-PaperPR-Fix-unnecessary-map-data-saves.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0159-PaperPR-Fix-unnecessary-map-data-saves.patch rename to leaf-server/minecraft-patches/features/0158-PaperPR-Fix-unnecessary-map-data-saves.patch diff --git a/leaf-server/minecraft-patches/features/0160-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch b/leaf-server/minecraft-patches/features/0159-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0160-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch rename to leaf-server/minecraft-patches/features/0159-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch diff --git a/leaf-server/minecraft-patches/features/0161-Sakura-copy-EntityList-implementation-to-BasicEntity.patch b/leaf-server/minecraft-patches/features/0160-Sakura-copy-EntityList-implementation-to-BasicEntity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0161-Sakura-copy-EntityList-implementation-to-BasicEntity.patch rename to leaf-server/minecraft-patches/features/0160-Sakura-copy-EntityList-implementation-to-BasicEntity.patch diff --git a/leaf-server/minecraft-patches/features/0162-Protocol-Core.patch b/leaf-server/minecraft-patches/features/0161-Protocol-Core.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0162-Protocol-Core.patch rename to leaf-server/minecraft-patches/features/0161-Protocol-Core.patch diff --git a/leaf-server/minecraft-patches/features/0163-Reduce-PlayerChunk-Updates.patch b/leaf-server/minecraft-patches/features/0162-Reduce-PlayerChunk-Updates.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0163-Reduce-PlayerChunk-Updates.patch rename to leaf-server/minecraft-patches/features/0162-Reduce-PlayerChunk-Updates.patch diff --git a/leaf-server/minecraft-patches/features/0164-Async-switch-connection-state.patch b/leaf-server/minecraft-patches/features/0163-Async-switch-connection-state.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0164-Async-switch-connection-state.patch rename to leaf-server/minecraft-patches/features/0163-Async-switch-connection-state.patch diff --git a/leaf-server/minecraft-patches/features/0165-Optimise-BlockEntities-tickersInLevel.patch b/leaf-server/minecraft-patches/features/0164-Optimise-BlockEntities-tickersInLevel.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0165-Optimise-BlockEntities-tickersInLevel.patch rename to leaf-server/minecraft-patches/features/0164-Optimise-BlockEntities-tickersInLevel.patch diff --git a/leaf-server/minecraft-patches/features/0166-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch b/leaf-server/minecraft-patches/features/0165-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0166-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch rename to leaf-server/minecraft-patches/features/0165-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch diff --git a/leaf-server/minecraft-patches/features/0167-Flush-location-while-knockback.patch b/leaf-server/minecraft-patches/features/0166-Flush-location-while-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0167-Flush-location-while-knockback.patch rename to leaf-server/minecraft-patches/features/0166-Flush-location-while-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0168-Only-tick-items-at-hand.patch b/leaf-server/minecraft-patches/features/0167-Only-tick-items-at-hand.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0168-Only-tick-items-at-hand.patch rename to leaf-server/minecraft-patches/features/0167-Only-tick-items-at-hand.patch diff --git a/leaf-server/minecraft-patches/features/0169-Smart-sort-items-in-NearestItemSensor.patch b/leaf-server/minecraft-patches/features/0168-Smart-sort-items-in-NearestItemSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0169-Smart-sort-items-in-NearestItemSensor.patch rename to leaf-server/minecraft-patches/features/0168-Smart-sort-items-in-NearestItemSensor.patch diff --git a/leaf-server/minecraft-patches/features/0170-Optimise-player-movement-checks.patch b/leaf-server/minecraft-patches/features/0169-Optimise-player-movement-checks.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0170-Optimise-player-movement-checks.patch rename to leaf-server/minecraft-patches/features/0169-Optimise-player-movement-checks.patch diff --git a/leaf-server/minecraft-patches/features/0171-Remove-streams-in-MobSensor.patch b/leaf-server/minecraft-patches/features/0170-Remove-streams-in-MobSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0171-Remove-streams-in-MobSensor.patch rename to leaf-server/minecraft-patches/features/0170-Remove-streams-in-MobSensor.patch diff --git a/leaf-server/minecraft-patches/features/0172-Remove-streams-in-TemptingSensor.patch b/leaf-server/minecraft-patches/features/0171-Remove-streams-in-TemptingSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0172-Remove-streams-in-TemptingSensor.patch rename to leaf-server/minecraft-patches/features/0171-Remove-streams-in-TemptingSensor.patch diff --git a/leaf-server/minecraft-patches/features/0173-Use-HashedList-on-WeightedRandomList.patch b/leaf-server/minecraft-patches/features/0172-Use-HashedList-on-WeightedRandomList.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0173-Use-HashedList-on-WeightedRandomList.patch rename to leaf-server/minecraft-patches/features/0172-Use-HashedList-on-WeightedRandomList.patch diff --git a/leaf-server/minecraft-patches/features/0174-Add-configurable-death-item-drop-knockback-settings.patch b/leaf-server/minecraft-patches/features/0173-Add-configurable-death-item-drop-knockback-settings.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0174-Add-configurable-death-item-drop-knockback-settings.patch rename to leaf-server/minecraft-patches/features/0173-Add-configurable-death-item-drop-knockback-settings.patch diff --git a/leaf-server/minecraft-patches/features/0175-Optimize-getScaledTrackingDistance.patch b/leaf-server/minecraft-patches/features/0174-Optimize-getScaledTrackingDistance.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0175-Optimize-getScaledTrackingDistance.patch rename to leaf-server/minecraft-patches/features/0174-Optimize-getScaledTrackingDistance.patch diff --git a/leaf-server/minecraft-patches/features/0176-Optimize-SynchedEntityData-packDirty.patch b/leaf-server/minecraft-patches/features/0175-Optimize-SynchedEntityData-packDirty.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0176-Optimize-SynchedEntityData-packDirty.patch rename to leaf-server/minecraft-patches/features/0175-Optimize-SynchedEntityData-packDirty.patch diff --git a/leaf-server/minecraft-patches/features/0177-Optimize-isEyeInFluid.patch b/leaf-server/minecraft-patches/features/0176-Optimize-isEyeInFluid.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0177-Optimize-isEyeInFluid.patch rename to leaf-server/minecraft-patches/features/0176-Optimize-isEyeInFluid.patch diff --git a/leaf-server/minecraft-patches/features/0178-Cache-block-path-type.patch b/leaf-server/minecraft-patches/features/0177-Cache-block-path-type.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0178-Cache-block-path-type.patch rename to leaf-server/minecraft-patches/features/0177-Cache-block-path-type.patch diff --git a/leaf-server/minecraft-patches/features/0179-optimize-getEntityStatus.patch b/leaf-server/minecraft-patches/features/0178-optimize-getEntityStatus.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0179-optimize-getEntityStatus.patch rename to leaf-server/minecraft-patches/features/0178-optimize-getEntityStatus.patch diff --git a/leaf-server/minecraft-patches/features/0180-Rail-Optimization-optimized-PoweredRailBlock-logic.patch b/leaf-server/minecraft-patches/features/0179-Rail-Optimization-optimized-PoweredRailBlock-logic.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0180-Rail-Optimization-optimized-PoweredRailBlock-logic.patch rename to leaf-server/minecraft-patches/features/0179-Rail-Optimization-optimized-PoweredRailBlock-logic.patch diff --git a/leaf-server/minecraft-patches/features/0181-optimise-ChunkGenerator-getMobsAt.patch b/leaf-server/minecraft-patches/features/0180-optimise-ChunkGenerator-getMobsAt.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0181-optimise-ChunkGenerator-getMobsAt.patch rename to leaf-server/minecraft-patches/features/0180-optimise-ChunkGenerator-getMobsAt.patch diff --git a/leaf-server/minecraft-patches/features/0182-optimise-getBiome.patch b/leaf-server/minecraft-patches/features/0181-optimise-getBiome.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0182-optimise-getBiome.patch rename to leaf-server/minecraft-patches/features/0181-optimise-getBiome.patch diff --git a/leaf-server/minecraft-patches/features/0183-optimize-mob-spawning.patch b/leaf-server/minecraft-patches/features/0182-optimize-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0183-optimize-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0182-optimize-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0184-optimize-structure-map.patch b/leaf-server/minecraft-patches/features/0183-optimize-structure-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0184-optimize-structure-map.patch rename to leaf-server/minecraft-patches/features/0183-optimize-structure-map.patch diff --git a/leaf-server/minecraft-patches/features/0185-throttle-mob-spawning.patch b/leaf-server/minecraft-patches/features/0184-throttle-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0185-throttle-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0184-throttle-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0186-preload-mob-spawning-position.patch b/leaf-server/minecraft-patches/features/0185-preload-mob-spawning-position.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0186-preload-mob-spawning-position.patch rename to leaf-server/minecraft-patches/features/0185-preload-mob-spawning-position.patch diff --git a/leaf-server/minecraft-patches/features/0187-Add-BlockExplosionHitEvent.patch b/leaf-server/minecraft-patches/features/0186-Add-BlockExplosionHitEvent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0187-Add-BlockExplosionHitEvent.patch rename to leaf-server/minecraft-patches/features/0186-Add-BlockExplosionHitEvent.patch diff --git a/leaf-server/minecraft-patches/features/0188-Old-Blast-Protection-explosion-knockback.patch b/leaf-server/minecraft-patches/features/0187-Old-Blast-Protection-explosion-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0188-Old-Blast-Protection-explosion-knockback.patch rename to leaf-server/minecraft-patches/features/0187-Old-Blast-Protection-explosion-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0189-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0188-Paw-optimization.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0189-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0188-Paw-optimization.patch diff --git a/leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0189-Use-UUID-for-cure-reputation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0190-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0189-Use-UUID-for-cure-reputation.patch diff --git a/leaf-server/minecraft-patches/features/0191-Cache-potential-behaviors-in-Brain.patch b/leaf-server/minecraft-patches/features/0190-Cache-potential-behaviors-in-Brain.patch similarity index 94% rename from leaf-server/minecraft-patches/features/0191-Cache-potential-behaviors-in-Brain.patch rename to leaf-server/minecraft-patches/features/0190-Cache-potential-behaviors-in-Brain.patch index 7b7cc23d..5b0006d5 100644 --- a/leaf-server/minecraft-patches/features/0191-Cache-potential-behaviors-in-Brain.patch +++ b/leaf-server/minecraft-patches/features/0190-Cache-potential-behaviors-in-Brain.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache potential behaviors in Brain diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java -index 457962b2113726c3cae7fed9c1926e8537834c3c..68eadc20d0bb80cac81dd3b6127c46ea484d39b0 100644 +index 97dad57ba873c0f6404a490e358739dbaf11bc55..34b66ee67927bc0796d6c5f069393618abca9d74 100644 --- a/net/minecraft/world/entity/ai/Brain.java +++ b/net/minecraft/world/entity/ai/Brain.java @@ -60,6 +60,7 @@ public class Brain { @@ -24,7 +24,7 @@ index 457962b2113726c3cae7fed9c1926e8537834c3c..68eadc20d0bb80cac81dd3b6127c46ea } public DataResult serializeStart(DynamicOps ops) { -@@ -343,6 +345,7 @@ public class Brain { +@@ -314,6 +316,7 @@ public class Brain { this.activeActivities.clear(); this.activeActivities.addAll(this.coreActivities); this.activeActivities.add(activity); @@ -32,7 +32,7 @@ index 457962b2113726c3cae7fed9c1926e8537834c3c..68eadc20d0bb80cac81dd3b6127c46ea } } -@@ -423,11 +426,13 @@ public class Brain { +@@ -394,11 +397,13 @@ public class Brain { .computeIfAbsent(activity, activity1 -> new it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet<>()) // Leaf - Replace brain activity maps with optimized collection .add((BehaviorControl)pair.getSecond()); } @@ -46,7 +46,7 @@ index 457962b2113726c3cae7fed9c1926e8537834c3c..68eadc20d0bb80cac81dd3b6127c46ea } public boolean isActive(Activity activity) { -@@ -481,30 +486,40 @@ public class Brain { +@@ -452,30 +457,40 @@ public class Brain { } } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/BrainRunningBehaviorCacheUpdate.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/BrainRunningBehaviorCacheUpdate.java deleted file mode 100644 index f1ae5bf9..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/opt/BrainRunningBehaviorCacheUpdate.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.dreeam.leaf.config.modules.opt; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class BrainRunningBehaviorCacheUpdate extends ConfigModules { - - public String getBasePath() { - return EnumConfigCategory.PERF.getBaseKeyName(); - } - - public static int interval = 5; - - @Override - public void onLoaded() { - interval = config.getInt(getBasePath() + ".entity-running-behavior-cache-update-interval", interval, - config.pickStringRegionBased( - "How often entity update current brain running behavior list.", - "生物更新现有 Brain Behavior 列表缓存的间隔.")); - } -}