From 006fe7ce3a58e687183271f02e1331f23fc5bd99 Mon Sep 17 00:00:00 2001 From: Taiyou <77050201+Taiyou06@users.noreply.github.com> Date: Thu, 24 Jul 2025 22:48:54 +0200 Subject: [PATCH] rewritten profile cache (#415) * rewritten profile cache * cleanup * Fix build * Update comments --- .../0134-Cache-player-profileResult.patch | 97 ------------ ...ed.patch => 0134-Matter-Secure-Seed.patch} | 0 ... => 0135-Matter-Secure-Seed-command.patch} | 0 ...tch => 0136-Faster-random-generator.patch} | 2 +- ...> 0137-Don-t-save-primed-tnt-entity.patch} | 0 ...138-Don-t-save-falling-block-entity.patch} | 0 ...139-Configurable-connection-message.patch} | 0 ...onfigurable-unknown-command-message.patch} | 0 ...-in-BlockBehaviour-cache-blockstate.patch} | 0 ...am-in-entity-visible-effects-filter.patch} | 2 +- ...-double-iteration-in-enough-deep-sl.patch} | 0 ...ove-stream-in-trial-spawner-ticking.patch} | 0 ...atch => 0145-Remove-stream-in-Brain.patch} | 0 ...0146-Remove-stream-in-BehaviorUtils.patch} | 0 ... 0147-Remove-stream-in-YieldJobSite.patch} | 0 ... 0148-Remove-stream-in-PlayerSensor.patch} | 0 ...> 0149-Remove-stream-in-GolemSensor.patch} | 0 ... 0150-Remove-stream-in-GateBehavior.patch} | 0 ... 0151-Remove-stream-in-matchingSlot.patch} | 0 ...entity-mountedOrDismounted-changes-.patch} | 0 ...tive-effects-map-with-optimized-col.patch} | 2 +- ...erion-map-with-optimized-collection.patch} | 0 ...ace-brain-with-optimized-collection.patch} | 0 ...=> 0156-Reduce-worldgen-allocations.patch} | 0 ...e-for-kickPermission-instead-of-usi.patch} | 2 +- ...-place-player-if-the-server-is-full.patch} | 0 ...MC-65198.patch => 0159-Fix-MC-65198.patch} | 0 ...-200418.patch => 0160-Fix-MC-200418.patch} | 0 ...-119417.patch => 0161-Fix-MC-119417.patch} | 0 ...-223153.patch => 0162-Fix-MC-223153.patch} | 0 ...onfigurable-player-knockback-zombie.patch} | 2 +- ...during-inactive-ticks-for-non-aware.patch} | 0 ...zombie-reinforcements-loading-chunk.patch} | 0 ...aperPR-Fix-some-beacon-event-issues.patch} | 0 ...67-Dont-send-useless-entity-packets.patch} | 0 ...patch => 0168-Multithreaded-Tracker.patch} | 0 ...0169-Nitori-Async-playerdata-saving.patch} | 0 ...e-nearby-alive-players-for-spawning.patch} | 0 ...> 0171-Cache-blockstate-cache-array.patch} | 0 ....patch => 0172-Asynchronous-locator.patch} | 0 ...tities-in-NearestLivingEntitySensor.patch} | 0 ...uce-memory-footprint-of-CompoundTag.patch} | 0 ... 0175-Optimize-Entity-distanceToSqr.patch} | 0 ...e-snapshots-for-TileEntity-getOwner.patch} | 0 ... => 0177-Cache-tile-entity-position.patch} | 0 ...patch => 0178-TT20-Lag-compensation.patch} | 2 +- ...tch => 0179-C2ME-Reduce-Allocations.patch} | 0 ...cessary-calculations-if-player-is-n.patch} | 2 +- ...til.patch => 0181-Lithium-fast-util.patch} | 0 ...182-Lithium-cached-iterate-outwards.patch} | 0 ...read-safe-ban-list-date-format-pars.patch} | 0 ...> 0184-C2ME-Optimize-world-gen-math.patch} | 0 ...k-key.patch => 0185-Cache-chunk-key.patch} | 2 +- ...0186-Cache-random-tick-block-status.patch} | 0 ...7-Cache-part-of-canHoldFluid-result.patch} | 0 ... => 0188-Configurable-tripwire-dupe.patch} | 0 ...7075-Block-Entities-Unload-Lag-Spik.patch} | 0 ...Rearrange-the-attackable-conditions.patch} | 0 ...-dirty-stats-copy-when-requesting-p.patch} | 0 ...t-dirty-flag-when-loading-maps-from.patch} | 2 +- ...hecking-nearby-players-for-spawning.patch} | 2 +- ...> 0194-Cache-supporting-block-check.patch} | 2 +- ...ue-clear-on-LevelTicks-cleanupAfter.patch} | 0 ... => 0196-Remove-stream-in-villagers.patch} | 0 ... 0197-Optimize-baby-villager-sensor.patch} | 0 ....patch => 0198-Only-player-pushable.patch} | 2 +- ...199-Remove-iterators-from-Inventory.patch} | 0 ....patch => 0200-optimize-mob-despawn.patch} | 0 ...-Slightly-optimise-getNearestPlayer.patch} | 0 ...writeLongArray-during-chunk-loading.patch} | 0 ...3-Improve-sorting-in-SortedArraySet.patch} | 0 ... 0204-Make-removeIf-slightly-faster.patch} | 0 ...atch => 0205-Optimize-LinearPalette.patch} | 0 ...206-Slightly-optimized-VarInt-write.patch} | 0 ...te-ClientboundLightUpdatePacketData.patch} | 0 ...g.patch => 0208-Async-chunk-sending.patch} | 0 ...atch => 0209-Spawner-Configurations.patch} | 0 ...SparklyPaper-Parallel-world-ticking.patch} | 0 ...-SparklyPaper-Track-each-world-MSPT.patch} | 2 +- ...lled-Projectile-Events-still-consum.patch} | 0 ...ndInteract-and-NearestVisibleLiving.patch} | 0 ... => 0214-rewrite-InsideBrownianWalk.patch} | 0 ...=> 0215-Use-BFS-on-getSlopeDistance.patch} | 2 +- ...r-PR-Throttle-failed-spawn-attempts.patch} | 0 ...BlockEntity-ticking-isRemoved-check.patch} | 0 ...8-Raytrace-AntiXray-SDK-integration.patch} | 2 +- ...timize-addOrUpdateTransientModifier.patch} | 0 ... => 0220-Optimize-ContextMap.create.patch} | 0 ...Micro-optimizations-for-random-tick.patch} | 2 +- ...n-updateConnectedPlayersWithinRange.patch} | 0 ...23-Remove-streams-on-PlayerDetector.patch} | 0 ...se-direct-iteration-on-Sensing.tick.patch} | 0 ...5-Optimise-non-flush-packet-sending.patch} | 0 ...unk-retrieving-in-entity-fluid-push.patch} | 2 +- ...-Null-handling-on-MultifaceSpreader.patch} | 0 ....patch => 0228-More-virtual-threads.patch} | 0 ....patch => 0229-Async-target-finding.patch} | 0 ...imize-ThreadedTicketLevelPropagator.patch} | 0 ...EffectUtil-getDigSpeedAmplification.patch} | 0 ...patch => 0232-Optimise-chunkUnloads.patch} | 0 ...33-Optimize-BlockEntityType-isValid.patch} | 0 ...t-on-player-join-to-avoid-chunk-loa.patch} | 0 ...yList-implementation-to-BasicEntity.patch} | 0 ...ol-Core.patch => 0236-Protocol-Core.patch} | 0 ... 0237-Async-switch-connection-state.patch} | 4 +- ...timize-BlockEntities-tickersInLevel.patch} | 0 ...e-cactus-can-even-survive-being-pla.patch} | 0 ...0240-Flush-location-while-knockback.patch} | 0 ...tch => 0241-Only-tick-items-at-hand.patch} | 0 ...art-sort-items-in-NearestItemSensor.patch} | 0 ...243-Optimise-player-movement-checks.patch} | 2 +- ...=> 0244-Remove-streams-in-MobSensor.patch} | 0 ...45-Remove-streams-in-TemptingSensor.patch} | 0 ...0246-Use-HashedList-on-WeightedList.patch} | 0 ...-death-item-drop-knockback-settings.patch} | 0 ...-Optimize-getScaledTrackingDistance.patch} | 0 ...ptimize-SynchedEntityData-packDirty.patch} | 0 ...patch => 0250-Optimize-isEyeInFluid.patch} | 2 +- ...patch => 0251-Cache-block-path-type.patch} | 0 ...ch => 0252-optimize-getEntityStatus.patch} | 0 ...on-optimized-PoweredRailBlock-logic.patch} | 0 ...4-optimise-ChunkGenerator-getMobsAt.patch} | 0 ...tBiome.patch => 0255-cache-getBiome.patch} | 0 ...patch => 0256-optimize-mob-spawning.patch} | 0 ...atch => 0257-optimize-structure-map.patch} | 0 ...patch => 0258-throttle-mob-spawning.patch} | 0 ... => 0259-Add-BlockExplosionHitEvent.patch} | 0 ...last-Protection-explosion-knockback.patch} | 0 ...> 0261-Use-UUID-for-cure-reputation.patch} | 0 ...ing-parsing-unknown-command-message.patch} | 0 ....patch => 0263-optimize-random-tick.patch} | 0 ...nvalid-flatten-text-component-parse.patch} | 0 ...-Fast-BiomeManager-seed-obfuscation.patch} | 0 ...ectorOptions-map-with-optimized-col.patch} | 0 ...tch => 0267-optimize-no-action-time.patch} | 0 ...int.patch => 0268-optimize-waypoint.patch} | 2 +- ...tion.patch => 0269-Paw-optimization.patch} | 2 +- ...ig-fixClimbingBypassingCrammingRule.patch} | 2 +- ...71-Skip-inactive-entity-for-execute.patch} | 0 ....patch => 0272-Optimise-getEntities.patch} | 0 ...-298464.patch => 0273-fix-MC-298464.patch} | 0 ...stHomeAsWalkTarget-s-poi-finding-to.patch} | 0 ...75-optimize-checkInsideBlocks-calls.patch} | 2 +- ...{0277-Op-lock.patch => 0276-Op-lock.patch} | 0 .../features/0063-cache-profile-data.patch | 146 ++++++++++++++++++ .../leaf/config/modules/misc/Cache.java | 29 ---- .../modules/misc/CacheProfileLookup.java | 31 ++++ 147 files changed, 202 insertions(+), 151 deletions(-) delete mode 100644 leaf-server/minecraft-patches/features/0134-Cache-player-profileResult.patch rename leaf-server/minecraft-patches/features/{0135-Matter-Secure-Seed.patch => 0134-Matter-Secure-Seed.patch} (100%) rename leaf-server/minecraft-patches/features/{0136-Matter-Secure-Seed-command.patch => 0135-Matter-Secure-Seed-command.patch} (100%) rename leaf-server/minecraft-patches/features/{0137-Faster-random-generator.patch => 0136-Faster-random-generator.patch} (99%) rename leaf-server/minecraft-patches/features/{0138-Don-t-save-primed-tnt-entity.patch => 0137-Don-t-save-primed-tnt-entity.patch} (100%) rename leaf-server/minecraft-patches/features/{0139-Don-t-save-falling-block-entity.patch => 0138-Don-t-save-falling-block-entity.patch} (100%) rename leaf-server/minecraft-patches/features/{0140-Configurable-connection-message.patch => 0139-Configurable-connection-message.patch} (100%) rename leaf-server/minecraft-patches/features/{0141-Configurable-unknown-command-message.patch => 0140-Configurable-unknown-command-message.patch} (100%) rename leaf-server/minecraft-patches/features/{0142-Remove-stream-in-BlockBehaviour-cache-blockstate.patch => 0141-Remove-stream-in-BlockBehaviour-cache-blockstate.patch} (100%) rename leaf-server/minecraft-patches/features/{0143-Remove-stream-in-entity-visible-effects-filter.patch => 0142-Remove-stream-in-entity-visible-effects-filter.patch} (93%) rename leaf-server/minecraft-patches/features/{0144-Remove-stream-and-double-iteration-in-enough-deep-sl.patch => 0143-Remove-stream-and-double-iteration-in-enough-deep-sl.patch} (100%) rename leaf-server/minecraft-patches/features/{0145-Remove-stream-in-trial-spawner-ticking.patch => 0144-Remove-stream-in-trial-spawner-ticking.patch} (100%) rename leaf-server/minecraft-patches/features/{0146-Remove-stream-in-Brain.patch => 0145-Remove-stream-in-Brain.patch} (100%) rename leaf-server/minecraft-patches/features/{0147-Remove-stream-in-BehaviorUtils.patch => 0146-Remove-stream-in-BehaviorUtils.patch} (100%) rename leaf-server/minecraft-patches/features/{0148-Remove-stream-in-YieldJobSite.patch => 0147-Remove-stream-in-YieldJobSite.patch} (100%) rename leaf-server/minecraft-patches/features/{0149-Remove-stream-in-PlayerSensor.patch => 0148-Remove-stream-in-PlayerSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0150-Remove-stream-in-GolemSensor.patch => 0149-Remove-stream-in-GolemSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0151-Remove-stream-in-GateBehavior.patch => 0150-Remove-stream-in-GateBehavior.patch} (100%) rename leaf-server/minecraft-patches/features/{0152-Remove-stream-in-matchingSlot.patch => 0151-Remove-stream-in-matchingSlot.patch} (100%) rename leaf-server/minecraft-patches/features/{0153-Remove-stream-in-entity-mountedOrDismounted-changes-.patch => 0152-Remove-stream-in-entity-mountedOrDismounted-changes-.patch} (100%) rename leaf-server/minecraft-patches/features/{0154-Replace-Entity-active-effects-map-with-optimized-col.patch => 0153-Replace-Entity-active-effects-map-with-optimized-col.patch} (96%) rename leaf-server/minecraft-patches/features/{0155-Replace-criterion-map-with-optimized-collection.patch => 0154-Replace-criterion-map-with-optimized-collection.patch} (100%) rename leaf-server/minecraft-patches/features/{0156-Replace-brain-with-optimized-collection.patch => 0155-Replace-brain-with-optimized-collection.patch} (100%) rename leaf-server/minecraft-patches/features/{0157-Reduce-worldgen-allocations.patch => 0156-Reduce-worldgen-allocations.patch} (100%) rename leaf-server/minecraft-patches/features/{0158-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch => 0157-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch} (97%) rename leaf-server/minecraft-patches/features/{0159-Do-not-place-player-if-the-server-is-full.patch => 0158-Do-not-place-player-if-the-server-is-full.patch} (100%) rename leaf-server/minecraft-patches/features/{0160-Fix-MC-65198.patch => 0159-Fix-MC-65198.patch} (100%) rename leaf-server/minecraft-patches/features/{0161-Fix-MC-200418.patch => 0160-Fix-MC-200418.patch} (100%) rename leaf-server/minecraft-patches/features/{0162-Fix-MC-119417.patch => 0161-Fix-MC-119417.patch} (100%) rename leaf-server/minecraft-patches/features/{0163-Fix-MC-223153.patch => 0162-Fix-MC-223153.patch} (100%) rename leaf-server/minecraft-patches/features/{0164-Configurable-player-knockback-zombie.patch => 0163-Configurable-player-knockback-zombie.patch} (95%) rename leaf-server/minecraft-patches/features/{0165-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch => 0164-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch} (100%) rename leaf-server/minecraft-patches/features/{0166-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch => 0165-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch} (100%) rename leaf-server/minecraft-patches/features/{0167-PaperPR-Fix-some-beacon-event-issues.patch => 0166-PaperPR-Fix-some-beacon-event-issues.patch} (100%) rename leaf-server/minecraft-patches/features/{0168-Dont-send-useless-entity-packets.patch => 0167-Dont-send-useless-entity-packets.patch} (100%) rename leaf-server/minecraft-patches/features/{0169-Multithreaded-Tracker.patch => 0168-Multithreaded-Tracker.patch} (100%) rename leaf-server/minecraft-patches/features/{0170-Nitori-Async-playerdata-saving.patch => 0169-Nitori-Async-playerdata-saving.patch} (100%) rename leaf-server/minecraft-patches/features/{0171-Optimize-nearby-alive-players-for-spawning.patch => 0170-Optimize-nearby-alive-players-for-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0172-Cache-blockstate-cache-array.patch => 0171-Cache-blockstate-cache-array.patch} (100%) rename leaf-server/minecraft-patches/features/{0173-Asynchronous-locator.patch => 0172-Asynchronous-locator.patch} (100%) rename leaf-server/minecraft-patches/features/{0174-Smart-sort-entities-in-NearestLivingEntitySensor.patch => 0173-Smart-sort-entities-in-NearestLivingEntitySensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0175-Further-reduce-memory-footprint-of-CompoundTag.patch => 0174-Further-reduce-memory-footprint-of-CompoundTag.patch} (100%) rename leaf-server/minecraft-patches/features/{0176-Optimize-Entity-distanceToSqr.patch => 0175-Optimize-Entity-distanceToSqr.patch} (100%) rename leaf-server/minecraft-patches/features/{0177-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch => 0176-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch} (100%) rename leaf-server/minecraft-patches/features/{0178-Cache-tile-entity-position.patch => 0177-Cache-tile-entity-position.patch} (100%) rename leaf-server/minecraft-patches/features/{0179-TT20-Lag-compensation.patch => 0178-TT20-Lag-compensation.patch} (97%) rename leaf-server/minecraft-patches/features/{0180-C2ME-Reduce-Allocations.patch => 0179-C2ME-Reduce-Allocations.patch} (100%) rename leaf-server/minecraft-patches/features/{0181-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch => 0180-Lithium-Skip-unnecessary-calculations-if-player-is-n.patch} (94%) rename leaf-server/minecraft-patches/features/{0182-Lithium-fast-util.patch => 0181-Lithium-fast-util.patch} (100%) rename leaf-server/minecraft-patches/features/{0183-Lithium-cached-iterate-outwards.patch => 0182-Lithium-cached-iterate-outwards.patch} (100%) rename leaf-server/minecraft-patches/features/{0184-Use-faster-and-thread-safe-ban-list-date-format-pars.patch => 0183-Use-faster-and-thread-safe-ban-list-date-format-pars.patch} (100%) rename leaf-server/minecraft-patches/features/{0185-C2ME-Optimize-world-gen-math.patch => 0184-C2ME-Optimize-world-gen-math.patch} (100%) rename leaf-server/minecraft-patches/features/{0186-Cache-chunk-key.patch => 0185-Cache-chunk-key.patch} (99%) rename leaf-server/minecraft-patches/features/{0187-Cache-random-tick-block-status.patch => 0186-Cache-random-tick-block-status.patch} (100%) rename leaf-server/minecraft-patches/features/{0188-Cache-part-of-canHoldFluid-result.patch => 0187-Cache-part-of-canHoldFluid-result.patch} (100%) rename leaf-server/minecraft-patches/features/{0189-Configurable-tripwire-dupe.patch => 0188-Configurable-tripwire-dupe.patch} (100%) rename leaf-server/minecraft-patches/features/{0190-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch => 0189-PaperPR-Fix-MC-117075-Block-Entities-Unload-Lag-Spik.patch} (100%) rename leaf-server/minecraft-patches/features/{0191-Sepals-Rearrange-the-attackable-conditions.patch => 0190-Sepals-Rearrange-the-attackable-conditions.patch} (100%) rename leaf-server/minecraft-patches/features/{0192-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch => 0191-SparklyPaper-Skip-dirty-stats-copy-when-requesting-p.patch} (100%) rename leaf-server/minecraft-patches/features/{0193-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch => 0192-SparklyPaper-Reset-dirty-flag-when-loading-maps-from.patch} (92%) rename leaf-server/minecraft-patches/features/{0194-Optimize-checking-nearby-players-for-spawning.patch => 0193-Optimize-checking-nearby-players-for-spawning.patch} (97%) rename leaf-server/minecraft-patches/features/{0195-Cache-supporting-block-check.patch => 0194-Cache-supporting-block-check.patch} (96%) rename leaf-server/minecraft-patches/features/{0196-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch => 0195-Avoid-useless-deque-clear-on-LevelTicks-cleanupAfter.patch} (100%) rename leaf-server/minecraft-patches/features/{0197-Remove-stream-in-villagers.patch => 0196-Remove-stream-in-villagers.patch} (100%) rename leaf-server/minecraft-patches/features/{0198-Optimize-baby-villager-sensor.patch => 0197-Optimize-baby-villager-sensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0199-Only-player-pushable.patch => 0198-Only-player-pushable.patch} (98%) rename leaf-server/minecraft-patches/features/{0200-Remove-iterators-from-Inventory.patch => 0199-Remove-iterators-from-Inventory.patch} (100%) rename leaf-server/minecraft-patches/features/{0201-optimize-mob-despawn.patch => 0200-optimize-mob-despawn.patch} (100%) rename leaf-server/minecraft-patches/features/{0202-Slightly-optimise-getNearestPlayer.patch => 0201-Slightly-optimise-getNearestPlayer.patch} (100%) rename leaf-server/minecraft-patches/features/{0203-Bulk-writes-to-writeLongArray-during-chunk-loading.patch => 0202-Bulk-writes-to-writeLongArray-during-chunk-loading.patch} (100%) rename leaf-server/minecraft-patches/features/{0204-Improve-sorting-in-SortedArraySet.patch => 0203-Improve-sorting-in-SortedArraySet.patch} (100%) rename leaf-server/minecraft-patches/features/{0205-Make-removeIf-slightly-faster.patch => 0204-Make-removeIf-slightly-faster.patch} (100%) rename leaf-server/minecraft-patches/features/{0206-Optimize-LinearPalette.patch => 0205-Optimize-LinearPalette.patch} (100%) rename leaf-server/minecraft-patches/features/{0207-Slightly-optimized-VarInt-write.patch => 0206-Slightly-optimized-VarInt-write.patch} (100%) rename leaf-server/minecraft-patches/features/{0208-Rewrite-ClientboundLightUpdatePacketData.patch => 0207-Rewrite-ClientboundLightUpdatePacketData.patch} (100%) rename leaf-server/minecraft-patches/features/{0209-Async-chunk-sending.patch => 0208-Async-chunk-sending.patch} (100%) rename leaf-server/minecraft-patches/features/{0210-Spawner-Configurations.patch => 0209-Spawner-Configurations.patch} (100%) rename leaf-server/minecraft-patches/features/{0211-SparklyPaper-Parallel-world-ticking.patch => 0210-SparklyPaper-Parallel-world-ticking.patch} (100%) rename leaf-server/minecraft-patches/features/{0212-SparklyPaper-Track-each-world-MSPT.patch => 0211-SparklyPaper-Track-each-world-MSPT.patch} (98%) rename leaf-server/minecraft-patches/features/{0213-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch => 0212-PaperPR-Fix-cancelled-Projectile-Events-still-consum.patch} (100%) rename leaf-server/minecraft-patches/features/{0214-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch => 0213-Optimize-SetLookAndInteract-and-NearestVisibleLiving.patch} (100%) rename leaf-server/minecraft-patches/features/{0215-rewrite-InsideBrownianWalk.patch => 0214-rewrite-InsideBrownianWalk.patch} (100%) rename leaf-server/minecraft-patches/features/{0216-Use-BFS-on-getSlopeDistance.patch => 0215-Use-BFS-on-getSlopeDistance.patch} (98%) rename leaf-server/minecraft-patches/features/{0217-Paper-PR-Throttle-failed-spawn-attempts.patch => 0216-Paper-PR-Throttle-failed-spawn-attempts.patch} (100%) rename leaf-server/minecraft-patches/features/{0218-Improve-BlockEntity-ticking-isRemoved-check.patch => 0217-Improve-BlockEntity-ticking-isRemoved-check.patch} (100%) rename leaf-server/minecraft-patches/features/{0219-Raytrace-AntiXray-SDK-integration.patch => 0218-Raytrace-AntiXray-SDK-integration.patch} (96%) rename leaf-server/minecraft-patches/features/{0220-Optimize-addOrUpdateTransientModifier.patch => 0219-Optimize-addOrUpdateTransientModifier.patch} (100%) rename leaf-server/minecraft-patches/features/{0221-Optimize-ContextMap.create.patch => 0220-Optimize-ContextMap.create.patch} (100%) rename leaf-server/minecraft-patches/features/{0222-Micro-optimizations-for-random-tick.patch => 0221-Micro-optimizations-for-random-tick.patch} (97%) rename leaf-server/minecraft-patches/features/{0223-Remove-streams-on-updateConnectedPlayersWithinRange.patch => 0222-Remove-streams-on-updateConnectedPlayersWithinRange.patch} (100%) rename leaf-server/minecraft-patches/features/{0224-Remove-streams-on-PlayerDetector.patch => 0223-Remove-streams-on-PlayerDetector.patch} (100%) rename leaf-server/minecraft-patches/features/{0225-Use-direct-iteration-on-Sensing.tick.patch => 0224-Use-direct-iteration-on-Sensing.tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0226-Optimise-non-flush-packet-sending.patch => 0225-Optimise-non-flush-packet-sending.patch} (100%) rename leaf-server/minecraft-patches/features/{0227-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch => 0226-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch} (96%) rename leaf-server/minecraft-patches/features/{0228-Null-handling-on-MultifaceSpreader.patch => 0227-Null-handling-on-MultifaceSpreader.patch} (100%) rename leaf-server/minecraft-patches/features/{0229-More-virtual-threads.patch => 0228-More-virtual-threads.patch} (100%) rename leaf-server/minecraft-patches/features/{0230-Async-target-finding.patch => 0229-Async-target-finding.patch} (100%) rename leaf-server/minecraft-patches/features/{0231-Optimize-ThreadedTicketLevelPropagator.patch => 0230-Optimize-ThreadedTicketLevelPropagator.patch} (100%) rename leaf-server/minecraft-patches/features/{0232-Optimise-MobEffectUtil-getDigSpeedAmplification.patch => 0231-Optimise-MobEffectUtil-getDigSpeedAmplification.patch} (100%) rename leaf-server/minecraft-patches/features/{0233-Optimise-chunkUnloads.patch => 0232-Optimise-chunkUnloads.patch} (100%) rename leaf-server/minecraft-patches/features/{0234-Optimize-BlockEntityType-isValid.patch => 0233-Optimize-BlockEntityType-isValid.patch} (100%) rename leaf-server/minecraft-patches/features/{0235-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch => 0234-PaperPR-Add-ticket-on-player-join-to-avoid-chunk-loa.patch} (100%) rename leaf-server/minecraft-patches/features/{0236-Sakura-copy-EntityList-implementation-to-BasicEntity.patch => 0235-Sakura-copy-EntityList-implementation-to-BasicEntity.patch} (100%) rename leaf-server/minecraft-patches/features/{0237-Protocol-Core.patch => 0236-Protocol-Core.patch} (100%) rename leaf-server/minecraft-patches/features/{0238-Async-switch-connection-state.patch => 0237-Async-switch-connection-state.patch} (98%) rename leaf-server/minecraft-patches/features/{0239-Optimize-BlockEntities-tickersInLevel.patch => 0238-Optimize-BlockEntities-tickersInLevel.patch} (100%) rename leaf-server/minecraft-patches/features/{0240-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch => 0239-Pluto-Check-if-the-cactus-can-even-survive-being-pla.patch} (100%) rename leaf-server/minecraft-patches/features/{0241-Flush-location-while-knockback.patch => 0240-Flush-location-while-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0242-Only-tick-items-at-hand.patch => 0241-Only-tick-items-at-hand.patch} (100%) rename leaf-server/minecraft-patches/features/{0243-Smart-sort-items-in-NearestItemSensor.patch => 0242-Smart-sort-items-in-NearestItemSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0244-Optimise-player-movement-checks.patch => 0243-Optimise-player-movement-checks.patch} (90%) rename leaf-server/minecraft-patches/features/{0245-Remove-streams-in-MobSensor.patch => 0244-Remove-streams-in-MobSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0246-Remove-streams-in-TemptingSensor.patch => 0245-Remove-streams-in-TemptingSensor.patch} (100%) rename leaf-server/minecraft-patches/features/{0247-Use-HashedList-on-WeightedList.patch => 0246-Use-HashedList-on-WeightedList.patch} (100%) rename leaf-server/minecraft-patches/features/{0248-Add-configurable-death-item-drop-knockback-settings.patch => 0247-Add-configurable-death-item-drop-knockback-settings.patch} (100%) rename leaf-server/minecraft-patches/features/{0249-Optimize-getScaledTrackingDistance.patch => 0248-Optimize-getScaledTrackingDistance.patch} (100%) rename leaf-server/minecraft-patches/features/{0250-Optimize-SynchedEntityData-packDirty.patch => 0249-Optimize-SynchedEntityData-packDirty.patch} (100%) rename leaf-server/minecraft-patches/features/{0251-Optimize-isEyeInFluid.patch => 0250-Optimize-isEyeInFluid.patch} (99%) rename leaf-server/minecraft-patches/features/{0252-Cache-block-path-type.patch => 0251-Cache-block-path-type.patch} (100%) rename leaf-server/minecraft-patches/features/{0253-optimize-getEntityStatus.patch => 0252-optimize-getEntityStatus.patch} (100%) rename leaf-server/minecraft-patches/features/{0254-Rail-Optimization-optimized-PoweredRailBlock-logic.patch => 0253-Rail-Optimization-optimized-PoweredRailBlock-logic.patch} (100%) rename leaf-server/minecraft-patches/features/{0255-optimise-ChunkGenerator-getMobsAt.patch => 0254-optimise-ChunkGenerator-getMobsAt.patch} (100%) rename leaf-server/minecraft-patches/features/{0256-cache-getBiome.patch => 0255-cache-getBiome.patch} (100%) rename leaf-server/minecraft-patches/features/{0257-optimize-mob-spawning.patch => 0256-optimize-mob-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0258-optimize-structure-map.patch => 0257-optimize-structure-map.patch} (100%) rename leaf-server/minecraft-patches/features/{0259-throttle-mob-spawning.patch => 0258-throttle-mob-spawning.patch} (100%) rename leaf-server/minecraft-patches/features/{0260-Add-BlockExplosionHitEvent.patch => 0259-Add-BlockExplosionHitEvent.patch} (100%) rename leaf-server/minecraft-patches/features/{0261-Old-Blast-Protection-explosion-knockback.patch => 0260-Old-Blast-Protection-explosion-knockback.patch} (100%) rename leaf-server/minecraft-patches/features/{0262-Use-UUID-for-cure-reputation.patch => 0261-Use-UUID-for-cure-reputation.patch} (100%) rename leaf-server/minecraft-patches/features/{0263-Fix-crash-during-parsing-unknown-command-message.patch => 0262-Fix-crash-during-parsing-unknown-command-message.patch} (100%) rename leaf-server/minecraft-patches/features/{0264-optimize-random-tick.patch => 0263-optimize-random-tick.patch} (100%) rename leaf-server/minecraft-patches/features/{0265-do-not-log-invalid-flatten-text-component-parse.patch => 0264-do-not-log-invalid-flatten-text-component-parse.patch} (100%) rename leaf-server/minecraft-patches/features/{0266-Fast-BiomeManager-seed-obfuscation.patch => 0265-Fast-BiomeManager-seed-obfuscation.patch} (100%) rename leaf-server/minecraft-patches/features/{0267-Replace-EntitySelectorOptions-map-with-optimized-col.patch => 0266-Replace-EntitySelectorOptions-map-with-optimized-col.patch} (100%) rename leaf-server/minecraft-patches/features/{0268-optimize-no-action-time.patch => 0267-optimize-no-action-time.patch} (100%) rename leaf-server/minecraft-patches/features/{0269-optimize-waypoint.patch => 0268-optimize-waypoint.patch} (96%) rename leaf-server/minecraft-patches/features/{0270-Paw-optimization.patch => 0269-Paw-optimization.patch} (99%) rename leaf-server/minecraft-patches/features/{0271-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch => 0270-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch} (95%) rename leaf-server/minecraft-patches/features/{0272-Skip-inactive-entity-for-execute.patch => 0271-Skip-inactive-entity-for-execute.patch} (100%) rename leaf-server/minecraft-patches/features/{0273-Optimise-getEntities.patch => 0272-Optimise-getEntities.patch} (100%) rename leaf-server/minecraft-patches/features/{0274-fix-MC-298464.patch => 0273-fix-MC-298464.patch} (100%) rename leaf-server/minecraft-patches/features/{0275-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch => 0274-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch} (100%) rename leaf-server/minecraft-patches/features/{0276-optimize-checkInsideBlocks-calls.patch => 0275-optimize-checkInsideBlocks-calls.patch} (99%) rename leaf-server/minecraft-patches/features/{0277-Op-lock.patch => 0276-Op-lock.patch} (100%) create mode 100644 leaf-server/paper-patches/features/0063-cache-profile-data.patch delete mode 100644 leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java create mode 100644 leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/CacheProfileLookup.java diff --git a/leaf-server/minecraft-patches/features/0134-Cache-player-profileResult.patch b/leaf-server/minecraft-patches/features/0134-Cache-player-profileResult.patch deleted file mode 100644 index 8d2fd25c..00000000 --- a/leaf-server/minecraft-patches/features/0134-Cache-player-profileResult.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> -Date: Thu, 28 Mar 2024 13:36:09 -0400 -Subject: [PATCH] Cache player profileResult - -This patch includes code that references the Caffeine caching library, -which is licensed under the Apache License, Version 2.0. - -Caffeine (https://github.com/ben-manes/caffeine) -Copyright (c) Ben Manes - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -diff --git a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index f68923c5f6fbecd8f1c10a30dbd06ed0dfee8b84..2e014cd543a6a790a0023835199b0e956e49fd1f 100644 ---- a/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -+++ b/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -71,6 +71,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public @Nullable java.util.UUID requestedUuid; // Paper - private final io.papermc.paper.connection.PaperPlayerLoginConnection paperLoginConnection; // Paper - Config API - private volatile boolean disconnecting = false; // Paper - Fix disconnect still ticking login -+ // Leaf start - Cache player profileResult -+ private static final com.github.benmanes.caffeine.cache.Cache playerProfileResultCache = com.github.benmanes.caffeine.cache.Caffeine.newBuilder() -+ .expireAfterWrite(org.dreeam.leaf.config.modules.misc.Cache.cachePlayerProfileResultTimeout, java.util.concurrent.TimeUnit.MINUTES) -+ .build(); -+ private static final com.github.benmanes.caffeine.cache.Cache playerSession = com.github.benmanes.caffeine.cache.Caffeine.newBuilder() -+ .expireAfterWrite(org.dreeam.leaf.config.modules.misc.Cache.cachePlayerProfileResultTimeout, java.util.concurrent.TimeUnit.MINUTES) -+ .build(); -+ // Leaf end - Cache player profileResult - - public ServerLoginPacketListenerImpl(MinecraftServer server, Connection connection, boolean transferred) { - this.server = server; -@@ -269,9 +277,30 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - String string1 = Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized"); - - try { -- ProfileResult profileResult = ServerLoginPacketListenerImpl.this.server -- .getSessionService() -- .hasJoinedServer(string1, string, this.getAddress()); -+ // Leaf start - Cache player profileResult -+ ProfileResult profileResult; -+ if (org.dreeam.leaf.config.modules.misc.Cache.cachePlayerProfileResult) { -+ profileResult = playerProfileResultCache.getIfPresent(string1); -+ -+ InetAddress address = this.getAddress(); -+ InetAddress lastAddress = playerSession.getIfPresent(string1); -+ if (isInvalidSession(address, lastAddress)) { -+ // Send request to mojang server to verify session -+ // Result will be null if is invalid and will do disconnect logic below -+ profileResult = ServerLoginPacketListenerImpl.this.server -+ .getSessionService() -+ .hasJoinedServer(string1, string, address); -+ if (profileResult != null && address != null) { -+ playerProfileResultCache.put(string1, profileResult); -+ playerSession.put(string1, address); -+ } -+ } -+ } else { -+ profileResult = ServerLoginPacketListenerImpl.this.server -+ .getSessionService() -+ .hasJoinedServer(string1, string, this.getAddress()); -+ } -+ // Leaf end - Cache player profileResult - if (profileResult != null) { - GameProfile gameProfile = profileResult.profile(); - // CraftBukkit start - fire PlayerPreLoginEvent -@@ -316,6 +345,20 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - // Paper end - Cache authenticator threads - } - -+ // Leaf start - Cache player profileResult -+ private static boolean isInvalidSession(@org.jetbrains.annotations.Nullable InetAddress currAddress, @org.jetbrains.annotations.Nullable InetAddress lastAddress) { -+ // Invalid address or non-public IP address -+ if (currAddress == null || -+ currAddress.isAnyLocalAddress() || -+ currAddress.isLinkLocalAddress() || -+ currAddress.isLoopbackAddress() || -+ currAddress.isSiteLocalAddress()) { -+ return true; -+ } -+ return !currAddress.equals(lastAddress); -+ } -+ // Leaf end - Cache player profileResult -+ - // CraftBukkit start - private GameProfile callPlayerPreLoginEvents(GameProfile gameprofile) throws Exception { // Paper - Add more fields to AsyncPlayerPreLoginEvent - // Paper start - Add Velocity IP Forwarding Support diff --git a/leaf-server/minecraft-patches/features/0135-Matter-Secure-Seed.patch b/leaf-server/minecraft-patches/features/0134-Matter-Secure-Seed.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0135-Matter-Secure-Seed.patch rename to leaf-server/minecraft-patches/features/0134-Matter-Secure-Seed.patch diff --git a/leaf-server/minecraft-patches/features/0136-Matter-Secure-Seed-command.patch b/leaf-server/minecraft-patches/features/0135-Matter-Secure-Seed-command.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0136-Matter-Secure-Seed-command.patch rename to leaf-server/minecraft-patches/features/0135-Matter-Secure-Seed-command.patch diff --git a/leaf-server/minecraft-patches/features/0137-Faster-random-generator.patch b/leaf-server/minecraft-patches/features/0136-Faster-random-generator.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0137-Faster-random-generator.patch rename to leaf-server/minecraft-patches/features/0136-Faster-random-generator.patch index 4818423e..814f40a2 100644 --- a/leaf-server/minecraft-patches/features/0137-Faster-random-generator.patch +++ b/leaf-server/minecraft-patches/features/0136-Faster-random-generator.patch @@ -97,7 +97,7 @@ index 8516d47b0ba79d91638837199e7ae0fb6cb44a79..4f4b55dd099dd2c2fea118b18b535881 RandomSource fork(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 0cdd3eb97e74aa3955f014a1f8f6a7d1580d323f..574be7359a2ad62c95a42c46c7a0f3c7a42eb44e 100644 +index ce331618d70d3dcfa576994e3f67f8c81fd6e8cc..2bed05da7e5ba52e85d437460679a7b81293fe5b 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -155,7 +155,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaf-server/minecraft-patches/features/0138-Don-t-save-primed-tnt-entity.patch b/leaf-server/minecraft-patches/features/0137-Don-t-save-primed-tnt-entity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0138-Don-t-save-primed-tnt-entity.patch rename to leaf-server/minecraft-patches/features/0137-Don-t-save-primed-tnt-entity.patch diff --git a/leaf-server/minecraft-patches/features/0139-Don-t-save-falling-block-entity.patch b/leaf-server/minecraft-patches/features/0138-Don-t-save-falling-block-entity.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0139-Don-t-save-falling-block-entity.patch rename to leaf-server/minecraft-patches/features/0138-Don-t-save-falling-block-entity.patch diff --git a/leaf-server/minecraft-patches/features/0140-Configurable-connection-message.patch b/leaf-server/minecraft-patches/features/0139-Configurable-connection-message.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0140-Configurable-connection-message.patch rename to leaf-server/minecraft-patches/features/0139-Configurable-connection-message.patch diff --git a/leaf-server/minecraft-patches/features/0141-Configurable-unknown-command-message.patch b/leaf-server/minecraft-patches/features/0140-Configurable-unknown-command-message.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0141-Configurable-unknown-command-message.patch rename to leaf-server/minecraft-patches/features/0140-Configurable-unknown-command-message.patch diff --git a/leaf-server/minecraft-patches/features/0142-Remove-stream-in-BlockBehaviour-cache-blockstate.patch b/leaf-server/minecraft-patches/features/0141-Remove-stream-in-BlockBehaviour-cache-blockstate.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0142-Remove-stream-in-BlockBehaviour-cache-blockstate.patch rename to leaf-server/minecraft-patches/features/0141-Remove-stream-in-BlockBehaviour-cache-blockstate.patch diff --git a/leaf-server/minecraft-patches/features/0143-Remove-stream-in-entity-visible-effects-filter.patch b/leaf-server/minecraft-patches/features/0142-Remove-stream-in-entity-visible-effects-filter.patch similarity index 93% rename from leaf-server/minecraft-patches/features/0143-Remove-stream-in-entity-visible-effects-filter.patch rename to leaf-server/minecraft-patches/features/0142-Remove-stream-in-entity-visible-effects-filter.patch index 238af3b2..9e499c74 100644 --- a/leaf-server/minecraft-patches/features/0143-Remove-stream-in-entity-visible-effects-filter.patch +++ b/leaf-server/minecraft-patches/features/0142-Remove-stream-in-entity-visible-effects-filter.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove stream in entity visible effects filter diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 34460363c4a5fbd274fee0f26d3731333c990072..df52963414f6c3b626eaed0f36a6cabdad68f398 100644 +index d8c3f05d36916e122bfd47d761b4d91ab54fd8f5..a75f8f86ebd3bb73b5fbeb389137344256e1175f 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -1013,12 +1013,15 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaf-server/minecraft-patches/features/0144-Remove-stream-and-double-iteration-in-enough-deep-sl.patch b/leaf-server/minecraft-patches/features/0143-Remove-stream-and-double-iteration-in-enough-deep-sl.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0144-Remove-stream-and-double-iteration-in-enough-deep-sl.patch rename to leaf-server/minecraft-patches/features/0143-Remove-stream-and-double-iteration-in-enough-deep-sl.patch diff --git a/leaf-server/minecraft-patches/features/0145-Remove-stream-in-trial-spawner-ticking.patch b/leaf-server/minecraft-patches/features/0144-Remove-stream-in-trial-spawner-ticking.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0145-Remove-stream-in-trial-spawner-ticking.patch rename to leaf-server/minecraft-patches/features/0144-Remove-stream-in-trial-spawner-ticking.patch diff --git a/leaf-server/minecraft-patches/features/0146-Remove-stream-in-Brain.patch b/leaf-server/minecraft-patches/features/0145-Remove-stream-in-Brain.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0146-Remove-stream-in-Brain.patch rename to leaf-server/minecraft-patches/features/0145-Remove-stream-in-Brain.patch diff --git a/leaf-server/minecraft-patches/features/0147-Remove-stream-in-BehaviorUtils.patch b/leaf-server/minecraft-patches/features/0146-Remove-stream-in-BehaviorUtils.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0147-Remove-stream-in-BehaviorUtils.patch rename to leaf-server/minecraft-patches/features/0146-Remove-stream-in-BehaviorUtils.patch diff --git a/leaf-server/minecraft-patches/features/0148-Remove-stream-in-YieldJobSite.patch b/leaf-server/minecraft-patches/features/0147-Remove-stream-in-YieldJobSite.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0148-Remove-stream-in-YieldJobSite.patch rename to leaf-server/minecraft-patches/features/0147-Remove-stream-in-YieldJobSite.patch diff --git a/leaf-server/minecraft-patches/features/0149-Remove-stream-in-PlayerSensor.patch b/leaf-server/minecraft-patches/features/0148-Remove-stream-in-PlayerSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0149-Remove-stream-in-PlayerSensor.patch rename to leaf-server/minecraft-patches/features/0148-Remove-stream-in-PlayerSensor.patch diff --git a/leaf-server/minecraft-patches/features/0150-Remove-stream-in-GolemSensor.patch b/leaf-server/minecraft-patches/features/0149-Remove-stream-in-GolemSensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0150-Remove-stream-in-GolemSensor.patch rename to leaf-server/minecraft-patches/features/0149-Remove-stream-in-GolemSensor.patch diff --git a/leaf-server/minecraft-patches/features/0151-Remove-stream-in-GateBehavior.patch b/leaf-server/minecraft-patches/features/0150-Remove-stream-in-GateBehavior.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0151-Remove-stream-in-GateBehavior.patch rename to leaf-server/minecraft-patches/features/0150-Remove-stream-in-GateBehavior.patch diff --git a/leaf-server/minecraft-patches/features/0152-Remove-stream-in-matchingSlot.patch b/leaf-server/minecraft-patches/features/0151-Remove-stream-in-matchingSlot.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0152-Remove-stream-in-matchingSlot.patch rename to leaf-server/minecraft-patches/features/0151-Remove-stream-in-matchingSlot.patch diff --git a/leaf-server/minecraft-patches/features/0153-Remove-stream-in-entity-mountedOrDismounted-changes-.patch b/leaf-server/minecraft-patches/features/0152-Remove-stream-in-entity-mountedOrDismounted-changes-.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0153-Remove-stream-in-entity-mountedOrDismounted-changes-.patch rename to leaf-server/minecraft-patches/features/0152-Remove-stream-in-entity-mountedOrDismounted-changes-.patch diff --git a/leaf-server/minecraft-patches/features/0154-Replace-Entity-active-effects-map-with-optimized-col.patch b/leaf-server/minecraft-patches/features/0153-Replace-Entity-active-effects-map-with-optimized-col.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0154-Replace-Entity-active-effects-map-with-optimized-col.patch rename to leaf-server/minecraft-patches/features/0153-Replace-Entity-active-effects-map-with-optimized-col.patch index 5fcbf028..d9affe7b 100644 --- a/leaf-server/minecraft-patches/features/0154-Replace-Entity-active-effects-map-with-optimized-col.patch +++ b/leaf-server/minecraft-patches/features/0153-Replace-Entity-active-effects-map-with-optimized-col.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Replace Entity active effects map with optimized collection Dreeam TODO: check this diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index df52963414f6c3b626eaed0f36a6cabdad68f398..4fc9b64bce70ef1169cf361d1414553f63f047ec 100644 +index a75f8f86ebd3bb73b5fbeb389137344256e1175f..1df69848c60a724b14bb6230a67ecd7cac1a0e03 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -208,6 +208,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaf-server/minecraft-patches/features/0155-Replace-criterion-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0154-Replace-criterion-map-with-optimized-collection.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0155-Replace-criterion-map-with-optimized-collection.patch rename to leaf-server/minecraft-patches/features/0154-Replace-criterion-map-with-optimized-collection.patch diff --git a/leaf-server/minecraft-patches/features/0156-Replace-brain-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0155-Replace-brain-with-optimized-collection.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0156-Replace-brain-with-optimized-collection.patch rename to leaf-server/minecraft-patches/features/0155-Replace-brain-with-optimized-collection.patch diff --git a/leaf-server/minecraft-patches/features/0157-Reduce-worldgen-allocations.patch b/leaf-server/minecraft-patches/features/0156-Reduce-worldgen-allocations.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0157-Reduce-worldgen-allocations.patch rename to leaf-server/minecraft-patches/features/0156-Reduce-worldgen-allocations.patch diff --git a/leaf-server/minecraft-patches/features/0158-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch b/leaf-server/minecraft-patches/features/0157-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0158-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch rename to leaf-server/minecraft-patches/features/0157-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch index b6585b19..a75566aa 100644 --- a/leaf-server/minecraft-patches/features/0158-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch +++ b/leaf-server/minecraft-patches/features/0157-Use-caffeine-cache-for-kickPermission-instead-of-usi.patch @@ -23,7 +23,7 @@ See the License for the specific language governing permissions and limitations under the License. diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index b3c138e78552ba348d67c37343c6684d37f2e10f..3f8b0c9f0d2172b1ffaee6c1065a91ff34b35953 100644 +index 0c73d4919e58b9282a8a6fc24fc7ab8e87b97b74..070fc3b4ec0558c597eb411db5b22edc447fe976 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -342,17 +342,12 @@ public class ServerGamePacketListenerImpl diff --git a/leaf-server/minecraft-patches/features/0159-Do-not-place-player-if-the-server-is-full.patch b/leaf-server/minecraft-patches/features/0158-Do-not-place-player-if-the-server-is-full.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0159-Do-not-place-player-if-the-server-is-full.patch rename to leaf-server/minecraft-patches/features/0158-Do-not-place-player-if-the-server-is-full.patch diff --git a/leaf-server/minecraft-patches/features/0160-Fix-MC-65198.patch b/leaf-server/minecraft-patches/features/0159-Fix-MC-65198.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0160-Fix-MC-65198.patch rename to leaf-server/minecraft-patches/features/0159-Fix-MC-65198.patch diff --git a/leaf-server/minecraft-patches/features/0161-Fix-MC-200418.patch b/leaf-server/minecraft-patches/features/0160-Fix-MC-200418.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0161-Fix-MC-200418.patch rename to leaf-server/minecraft-patches/features/0160-Fix-MC-200418.patch diff --git a/leaf-server/minecraft-patches/features/0162-Fix-MC-119417.patch b/leaf-server/minecraft-patches/features/0161-Fix-MC-119417.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0162-Fix-MC-119417.patch rename to leaf-server/minecraft-patches/features/0161-Fix-MC-119417.patch diff --git a/leaf-server/minecraft-patches/features/0163-Fix-MC-223153.patch b/leaf-server/minecraft-patches/features/0162-Fix-MC-223153.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0163-Fix-MC-223153.patch rename to leaf-server/minecraft-patches/features/0162-Fix-MC-223153.patch diff --git a/leaf-server/minecraft-patches/features/0164-Configurable-player-knockback-zombie.patch b/leaf-server/minecraft-patches/features/0163-Configurable-player-knockback-zombie.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0164-Configurable-player-knockback-zombie.patch rename to leaf-server/minecraft-patches/features/0163-Configurable-player-knockback-zombie.patch index 25a2b11c..e7c18f07 100644 --- a/leaf-server/minecraft-patches/features/0164-Configurable-player-knockback-zombie.patch +++ b/leaf-server/minecraft-patches/features/0163-Configurable-player-knockback-zombie.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable player knockback zombie diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 4fc9b64bce70ef1169cf361d1414553f63f047ec..d81d1303fc3d23b35dbc177dd6a4c7f489eb5381 100644 +index 1df69848c60a724b14bb6230a67ecd7cac1a0e03..f63d0af0f6dc8a634f56f329d256affeaeac17da 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -2111,6 +2111,8 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaf-server/minecraft-patches/features/0165-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch b/leaf-server/minecraft-patches/features/0164-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0165-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch rename to leaf-server/minecraft-patches/features/0164-Paper-PR-Skip-AI-during-inactive-ticks-for-non-aware.patch diff --git a/leaf-server/minecraft-patches/features/0166-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch b/leaf-server/minecraft-patches/features/0165-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0166-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch rename to leaf-server/minecraft-patches/features/0165-Paper-PR-Prevent-zombie-reinforcements-loading-chunk.patch diff --git a/leaf-server/minecraft-patches/features/0167-PaperPR-Fix-some-beacon-event-issues.patch b/leaf-server/minecraft-patches/features/0166-PaperPR-Fix-some-beacon-event-issues.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0167-PaperPR-Fix-some-beacon-event-issues.patch rename to leaf-server/minecraft-patches/features/0166-PaperPR-Fix-some-beacon-event-issues.patch diff --git a/leaf-server/minecraft-patches/features/0168-Dont-send-useless-entity-packets.patch b/leaf-server/minecraft-patches/features/0167-Dont-send-useless-entity-packets.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0168-Dont-send-useless-entity-packets.patch rename to leaf-server/minecraft-patches/features/0167-Dont-send-useless-entity-packets.patch diff --git a/leaf-server/minecraft-patches/features/0169-Multithreaded-Tracker.patch b/leaf-server/minecraft-patches/features/0168-Multithreaded-Tracker.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0169-Multithreaded-Tracker.patch rename to leaf-server/minecraft-patches/features/0168-Multithreaded-Tracker.patch diff --git a/leaf-server/minecraft-patches/features/0170-Nitori-Async-playerdata-saving.patch b/leaf-server/minecraft-patches/features/0169-Nitori-Async-playerdata-saving.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0170-Nitori-Async-playerdata-saving.patch rename to leaf-server/minecraft-patches/features/0169-Nitori-Async-playerdata-saving.patch diff --git a/leaf-server/minecraft-patches/features/0171-Optimize-nearby-alive-players-for-spawning.patch b/leaf-server/minecraft-patches/features/0170-Optimize-nearby-alive-players-for-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0171-Optimize-nearby-alive-players-for-spawning.patch rename to leaf-server/minecraft-patches/features/0170-Optimize-nearby-alive-players-for-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0172-Cache-blockstate-cache-array.patch b/leaf-server/minecraft-patches/features/0171-Cache-blockstate-cache-array.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0172-Cache-blockstate-cache-array.patch rename to leaf-server/minecraft-patches/features/0171-Cache-blockstate-cache-array.patch diff --git a/leaf-server/minecraft-patches/features/0173-Asynchronous-locator.patch b/leaf-server/minecraft-patches/features/0172-Asynchronous-locator.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0173-Asynchronous-locator.patch rename to leaf-server/minecraft-patches/features/0172-Asynchronous-locator.patch diff --git a/leaf-server/minecraft-patches/features/0174-Smart-sort-entities-in-NearestLivingEntitySensor.patch b/leaf-server/minecraft-patches/features/0173-Smart-sort-entities-in-NearestLivingEntitySensor.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0174-Smart-sort-entities-in-NearestLivingEntitySensor.patch rename to leaf-server/minecraft-patches/features/0173-Smart-sort-entities-in-NearestLivingEntitySensor.patch diff --git a/leaf-server/minecraft-patches/features/0175-Further-reduce-memory-footprint-of-CompoundTag.patch b/leaf-server/minecraft-patches/features/0174-Further-reduce-memory-footprint-of-CompoundTag.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0175-Further-reduce-memory-footprint-of-CompoundTag.patch rename to leaf-server/minecraft-patches/features/0174-Further-reduce-memory-footprint-of-CompoundTag.patch diff --git a/leaf-server/minecraft-patches/features/0176-Optimize-Entity-distanceToSqr.patch b/leaf-server/minecraft-patches/features/0175-Optimize-Entity-distanceToSqr.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0176-Optimize-Entity-distanceToSqr.patch rename to leaf-server/minecraft-patches/features/0175-Optimize-Entity-distanceToSqr.patch diff --git a/leaf-server/minecraft-patches/features/0177-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch b/leaf-server/minecraft-patches/features/0176-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0177-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch rename to leaf-server/minecraft-patches/features/0176-EMC-Don-t-use-snapshots-for-TileEntity-getOwner.patch diff --git a/leaf-server/minecraft-patches/features/0178-Cache-tile-entity-position.patch b/leaf-server/minecraft-patches/features/0177-Cache-tile-entity-position.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0178-Cache-tile-entity-position.patch rename to leaf-server/minecraft-patches/features/0177-Cache-tile-entity-position.patch diff --git a/leaf-server/minecraft-patches/features/0179-TT20-Lag-compensation.patch b/leaf-server/minecraft-patches/features/0178-TT20-Lag-compensation.patch similarity index 97% rename from leaf-server/minecraft-patches/features/0179-TT20-Lag-compensation.patch rename to leaf-server/minecraft-patches/features/0178-TT20-Lag-compensation.patch index f2c38fce..d825871e 100644 --- a/leaf-server/minecraft-patches/features/0179-TT20-Lag-compensation.patch +++ b/leaf-server/minecraft-patches/features/0178-TT20-Lag-compensation.patch @@ -7,7 +7,7 @@ Original license: AGPL-3.0 Original project: https://github.com/snackbag/TT20 diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index 07943aa3be4222ab7a63b09a6625f7a003da8725..3c45e6eac0403c9cb13409c8e0e9c1653fd531ba 100644 +index 6c1a8925b1e13a0ebddc1b45a980fe8bdd8676cf..169d4c5e317af201a2d5ad0d82d39805376c2e9e 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java @@ -1541,6 +1541,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0) { this.awardStat(Stats.WALK_UNDER_WATER_ONE_CM, rounded); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index ab0cf0bff7b477327fd92a20e6c7bc7d62f418d2..ceede6519645cb488ea4152842e00751eef53a6c 100644 +index f70fff36ba616afbd1869caeee1b20d4c1579a19..e054c2416919fe8814412e6e06cd82e4ea537c84 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -288,7 +288,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaf-server/minecraft-patches/features/0252-Cache-block-path-type.patch b/leaf-server/minecraft-patches/features/0251-Cache-block-path-type.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0252-Cache-block-path-type.patch rename to leaf-server/minecraft-patches/features/0251-Cache-block-path-type.patch diff --git a/leaf-server/minecraft-patches/features/0253-optimize-getEntityStatus.patch b/leaf-server/minecraft-patches/features/0252-optimize-getEntityStatus.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0253-optimize-getEntityStatus.patch rename to leaf-server/minecraft-patches/features/0252-optimize-getEntityStatus.patch diff --git a/leaf-server/minecraft-patches/features/0254-Rail-Optimization-optimized-PoweredRailBlock-logic.patch b/leaf-server/minecraft-patches/features/0253-Rail-Optimization-optimized-PoweredRailBlock-logic.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0254-Rail-Optimization-optimized-PoweredRailBlock-logic.patch rename to leaf-server/minecraft-patches/features/0253-Rail-Optimization-optimized-PoweredRailBlock-logic.patch diff --git a/leaf-server/minecraft-patches/features/0255-optimise-ChunkGenerator-getMobsAt.patch b/leaf-server/minecraft-patches/features/0254-optimise-ChunkGenerator-getMobsAt.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0255-optimise-ChunkGenerator-getMobsAt.patch rename to leaf-server/minecraft-patches/features/0254-optimise-ChunkGenerator-getMobsAt.patch diff --git a/leaf-server/minecraft-patches/features/0256-cache-getBiome.patch b/leaf-server/minecraft-patches/features/0255-cache-getBiome.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0256-cache-getBiome.patch rename to leaf-server/minecraft-patches/features/0255-cache-getBiome.patch diff --git a/leaf-server/minecraft-patches/features/0257-optimize-mob-spawning.patch b/leaf-server/minecraft-patches/features/0256-optimize-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0257-optimize-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0256-optimize-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0258-optimize-structure-map.patch b/leaf-server/minecraft-patches/features/0257-optimize-structure-map.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0258-optimize-structure-map.patch rename to leaf-server/minecraft-patches/features/0257-optimize-structure-map.patch diff --git a/leaf-server/minecraft-patches/features/0259-throttle-mob-spawning.patch b/leaf-server/minecraft-patches/features/0258-throttle-mob-spawning.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0259-throttle-mob-spawning.patch rename to leaf-server/minecraft-patches/features/0258-throttle-mob-spawning.patch diff --git a/leaf-server/minecraft-patches/features/0260-Add-BlockExplosionHitEvent.patch b/leaf-server/minecraft-patches/features/0259-Add-BlockExplosionHitEvent.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0260-Add-BlockExplosionHitEvent.patch rename to leaf-server/minecraft-patches/features/0259-Add-BlockExplosionHitEvent.patch diff --git a/leaf-server/minecraft-patches/features/0261-Old-Blast-Protection-explosion-knockback.patch b/leaf-server/minecraft-patches/features/0260-Old-Blast-Protection-explosion-knockback.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0261-Old-Blast-Protection-explosion-knockback.patch rename to leaf-server/minecraft-patches/features/0260-Old-Blast-Protection-explosion-knockback.patch diff --git a/leaf-server/minecraft-patches/features/0262-Use-UUID-for-cure-reputation.patch b/leaf-server/minecraft-patches/features/0261-Use-UUID-for-cure-reputation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0262-Use-UUID-for-cure-reputation.patch rename to leaf-server/minecraft-patches/features/0261-Use-UUID-for-cure-reputation.patch diff --git a/leaf-server/minecraft-patches/features/0263-Fix-crash-during-parsing-unknown-command-message.patch b/leaf-server/minecraft-patches/features/0262-Fix-crash-during-parsing-unknown-command-message.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0263-Fix-crash-during-parsing-unknown-command-message.patch rename to leaf-server/minecraft-patches/features/0262-Fix-crash-during-parsing-unknown-command-message.patch diff --git a/leaf-server/minecraft-patches/features/0264-optimize-random-tick.patch b/leaf-server/minecraft-patches/features/0263-optimize-random-tick.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0264-optimize-random-tick.patch rename to leaf-server/minecraft-patches/features/0263-optimize-random-tick.patch diff --git a/leaf-server/minecraft-patches/features/0265-do-not-log-invalid-flatten-text-component-parse.patch b/leaf-server/minecraft-patches/features/0264-do-not-log-invalid-flatten-text-component-parse.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0265-do-not-log-invalid-flatten-text-component-parse.patch rename to leaf-server/minecraft-patches/features/0264-do-not-log-invalid-flatten-text-component-parse.patch diff --git a/leaf-server/minecraft-patches/features/0266-Fast-BiomeManager-seed-obfuscation.patch b/leaf-server/minecraft-patches/features/0265-Fast-BiomeManager-seed-obfuscation.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0266-Fast-BiomeManager-seed-obfuscation.patch rename to leaf-server/minecraft-patches/features/0265-Fast-BiomeManager-seed-obfuscation.patch diff --git a/leaf-server/minecraft-patches/features/0267-Replace-EntitySelectorOptions-map-with-optimized-col.patch b/leaf-server/minecraft-patches/features/0266-Replace-EntitySelectorOptions-map-with-optimized-col.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0267-Replace-EntitySelectorOptions-map-with-optimized-col.patch rename to leaf-server/minecraft-patches/features/0266-Replace-EntitySelectorOptions-map-with-optimized-col.patch diff --git a/leaf-server/minecraft-patches/features/0268-optimize-no-action-time.patch b/leaf-server/minecraft-patches/features/0267-optimize-no-action-time.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0268-optimize-no-action-time.patch rename to leaf-server/minecraft-patches/features/0267-optimize-no-action-time.patch diff --git a/leaf-server/minecraft-patches/features/0269-optimize-waypoint.patch b/leaf-server/minecraft-patches/features/0268-optimize-waypoint.patch similarity index 96% rename from leaf-server/minecraft-patches/features/0269-optimize-waypoint.patch rename to leaf-server/minecraft-patches/features/0268-optimize-waypoint.patch index 9faccfc8..8b737ead 100644 --- a/leaf-server/minecraft-patches/features/0269-optimize-waypoint.patch +++ b/leaf-server/minecraft-patches/features/0268-optimize-waypoint.patch @@ -5,7 +5,7 @@ Subject: [PATCH] optimize waypoint diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index e054c2416919fe8814412e6e06cd82e4ea537c84..a253d714670f932d67e2c44fdf895716b6b595ec 100644 +index ceede6519645cb488ea4152842e00751eef53a6c..5eaaeb6f6a87d3a2d851b1840c4f3acbc47a0766 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -5144,6 +5144,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaf-server/minecraft-patches/features/0270-Paw-optimization.patch b/leaf-server/minecraft-patches/features/0269-Paw-optimization.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0270-Paw-optimization.patch rename to leaf-server/minecraft-patches/features/0269-Paw-optimization.patch index d35e99e0..042f4a63 100644 --- a/leaf-server/minecraft-patches/features/0270-Paw-optimization.patch +++ b/leaf-server/minecraft-patches/features/0269-Paw-optimization.patch @@ -132,7 +132,7 @@ index 964c97a394122083a2f3c77b8ca529592c826080..a58ba94171b54feee82e4ec3d68d23f4 private void tickPassenger(Entity ridingEntity, Entity passengerEntity, final boolean isActive) { // Paper - EAR 2 diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index a253d714670f932d67e2c44fdf895716b6b595ec..641ad9779e7822d29d35a199fed8766887e62a8e 100644 +index 5eaaeb6f6a87d3a2d851b1840c4f3acbc47a0766..30a8c865bc754216266a1d1932130972f2fd67a2 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -1170,16 +1170,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaf-server/minecraft-patches/features/0271-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch b/leaf-server/minecraft-patches/features/0270-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch similarity index 95% rename from leaf-server/minecraft-patches/features/0271-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch rename to leaf-server/minecraft-patches/features/0270-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch index c0cf0696..2eea5860 100644 --- a/leaf-server/minecraft-patches/features/0271-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch +++ b/leaf-server/minecraft-patches/features/0270-Fix-Paper-config-fixClimbingBypassingCrammingRule.patch @@ -19,7 +19,7 @@ index 5307e80f6e84df7a053e7132883d8338bbd751a0..d6be86981219f0fe0db15d36d9c85e9a // Leaf end - Only player pushable if (!pushableEntities.isEmpty()) { diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 9b4e6fdbedfa378ea436cdd5f1a36e2b3d94be17..645fad313ed3cd6ea5afe25c5d29dce828993371 100644 +index 06b46b973df84b16842a28f73df75613d09e75c9..f1f2775b56caf4820e03aa87f895c6570b271187 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java @@ -1909,7 +1909,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl diff --git a/leaf-server/minecraft-patches/features/0272-Skip-inactive-entity-for-execute.patch b/leaf-server/minecraft-patches/features/0271-Skip-inactive-entity-for-execute.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0272-Skip-inactive-entity-for-execute.patch rename to leaf-server/minecraft-patches/features/0271-Skip-inactive-entity-for-execute.patch diff --git a/leaf-server/minecraft-patches/features/0273-Optimise-getEntities.patch b/leaf-server/minecraft-patches/features/0272-Optimise-getEntities.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0273-Optimise-getEntities.patch rename to leaf-server/minecraft-patches/features/0272-Optimise-getEntities.patch diff --git a/leaf-server/minecraft-patches/features/0274-fix-MC-298464.patch b/leaf-server/minecraft-patches/features/0273-fix-MC-298464.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0274-fix-MC-298464.patch rename to leaf-server/minecraft-patches/features/0273-fix-MC-298464.patch diff --git a/leaf-server/minecraft-patches/features/0275-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch b/leaf-server/minecraft-patches/features/0274-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0275-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch rename to leaf-server/minecraft-patches/features/0274-Re-route-SetClosestHomeAsWalkTarget-s-poi-finding-to.patch diff --git a/leaf-server/minecraft-patches/features/0276-optimize-checkInsideBlocks-calls.patch b/leaf-server/minecraft-patches/features/0275-optimize-checkInsideBlocks-calls.patch similarity index 99% rename from leaf-server/minecraft-patches/features/0276-optimize-checkInsideBlocks-calls.patch rename to leaf-server/minecraft-patches/features/0275-optimize-checkInsideBlocks-calls.patch index 2b09f2d0..a7ba6ec6 100644 --- a/leaf-server/minecraft-patches/features/0276-optimize-checkInsideBlocks-calls.patch +++ b/leaf-server/minecraft-patches/features/0275-optimize-checkInsideBlocks-calls.patch @@ -11,7 +11,7 @@ Subject: [PATCH] optimize checkInsideBlocks calls License: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 641ad9779e7822d29d35a199fed8766887e62a8e..4a6f3e060496c831f8d810148e4f36a57f5e9f5d 100644 +index 30a8c865bc754216266a1d1932130972f2fd67a2..e7b375720c1bb78a9c3edf6d49c973eba1fcf115 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -1733,8 +1733,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaf-server/minecraft-patches/features/0277-Op-lock.patch b/leaf-server/minecraft-patches/features/0276-Op-lock.patch similarity index 100% rename from leaf-server/minecraft-patches/features/0277-Op-lock.patch rename to leaf-server/minecraft-patches/features/0276-Op-lock.patch diff --git a/leaf-server/paper-patches/features/0063-cache-profile-data.patch b/leaf-server/paper-patches/features/0063-cache-profile-data.patch new file mode 100644 index 00000000..a3c4a493 --- /dev/null +++ b/leaf-server/paper-patches/features/0063-cache-profile-data.patch @@ -0,0 +1,146 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Taiyou06 +Date: Tue, 22 Jul 2025 01:24:40 +0200 +Subject: [PATCH] cache profile data + +This patch includes code that references the Caffeine caching library, +which is licensed under the Apache License, Version 2.0. + +Caffeine (https://github.com/ben-manes/caffeine) +Copyright (c) Ben Manes + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +Aside from the Caffeine cache, the code is licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html) + +diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +index d2d16055df7ca3c625a720dfca5b4cd090e2972e..db43329d57144471d0c9ce0eed92d2f1bd05f120 100644 +--- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java ++++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +@@ -35,6 +35,13 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile { + private GameProfile profile; + private final PropertySet properties = new PropertySet(); + ++ // Leaf start - cache profile data ++ private static final com.github.benmanes.caffeine.cache.Cache PROFILE_DATA_CACHE = com.github.benmanes.caffeine.cache.Caffeine.newBuilder() ++ .expireAfterWrite(org.dreeam.leaf.config.modules.misc.CacheProfileLookup.timeout, java.util.concurrent.TimeUnit.MINUTES) ++ .maximumSize(org.dreeam.leaf.config.modules.misc.CacheProfileLookup.maxSize) ++ .build(); ++ // Leaf end - cache profile data ++ + public CraftPlayerProfile(CraftPlayer player) { + this.profile = player.getHandle().getGameProfile(); + } +@@ -195,11 +202,7 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile { + + @Override + public @NotNull CompletableFuture update() { +- return CompletableFuture.supplyAsync(() -> { +- final CraftPlayerProfile clone = clone(); +- clone.complete(true); +- return clone; +- }, Util.PROFILE_EXECUTOR); ++ return CompletableFuture.supplyAsync(this::getNewProfile, Util.PROFILE_EXECUTOR); // Leaf - cache profile data + } + + @Override +@@ -260,7 +263,7 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile { + MinecraftServer server = MinecraftServer.getServer(); + boolean isCompleteFromCache = this.completeFromCache(true, onlineMode); + if (onlineMode && (!isCompleteFromCache || (textures && !hasTextures()))) { +- ProfileResult result = server.getSessionService().fetchProfile(this.profile.getId(), true); ++ ProfileResult result = this.fetchProfile(server); // Leaf - cache profile data + if (result != null && result.profile() != null) { + copyProfileProperties(result.profile(), this.profile, true); + } +@@ -271,6 +274,80 @@ public class CraftPlayerProfile implements PlayerProfile, SharedPlayerProfile { + return this.isComplete() && (!onlineMode || !textures || hasTextures()); + } + ++ // Leaf start - cache profile data ++ // com.destroystokyo.paper.profile.CraftPlayerProfile#update is never used in server internal ++ // Probably only very rare plugins may use this. So here is just for cache update consistency. ++ // getNewProfile originally copied from org.bukkit.craftbukkit.profile.CraftPlayerProfile#getUpdatedProfile ++ private CraftPlayerProfile getNewProfile() { ++ MinecraftServer server = MinecraftServer.getServer(); ++ GameProfile currentProfile = this.buildGameProfile(); ++ ++ // Try to get profile from cache if UUID is not set ++ if (currentProfile.getId().equals(Util.NIL_UUID) && server.getProfileCache() != null) { ++ currentProfile = server.getProfileCache().get(currentProfile.getName()).orElse(currentProfile); ++ } ++ ++ // Fetch profile data if we have a valid UUID ++ if (!currentProfile.getId().equals(Util.NIL_UUID)) { ++ if (org.dreeam.leaf.config.modules.misc.CacheProfileLookup.enabled && ++ PROFILE_DATA_CACHE.asMap().containsKey(currentProfile.getId())) { ++ ++ ProfileResult cachedData = PROFILE_DATA_CACHE.getIfPresent(currentProfile.getId()); ++ if (cachedData != null) { ++ currentProfile = cachedData.profile(); ++ } ++ } else { ++ ProfileResult fetchedData = server.getSessionService().fetchProfile(currentProfile.getId(), true); ++ if (org.dreeam.leaf.config.modules.misc.CacheProfileLookup.enabled && fetchedData != null) { ++ PROFILE_DATA_CACHE.put(currentProfile.getId(), fetchedData); ++ } ++ if (fetchedData != null) { ++ currentProfile = fetchedData.profile(); ++ } ++ } ++ } ++ ++ return new CraftPlayerProfile(currentProfile); ++ } ++ ++ private ProfileResult fetchProfile(MinecraftServer server) { ++ GameProfile targetProfile = this.buildGameProfile(); ++ ++ // Resolve UUID from name cache if needed ++ if (targetProfile.getId().equals(Util.NIL_UUID) && server.getProfileCache() != null) { ++ targetProfile = server.getProfileCache().get(targetProfile.getName()).orElse(targetProfile); ++ } ++ ++ // Skip if still no valid UUID ++ if (targetProfile.getId().equals(Util.NIL_UUID)) { ++ return null; ++ } ++ ++ // Check cache first if enabled ++ if (org.dreeam.leaf.config.modules.misc.CacheProfileLookup.enabled) { ++ ProfileResult cachedResult = PROFILE_DATA_CACHE.getIfPresent(targetProfile.getId()); ++ if (cachedResult != null) { ++ return cachedResult; ++ } ++ } ++ ++ // Fetch fresh data from Mojang ++ ProfileResult fetchedResult = server.getSessionService().fetchProfile(targetProfile.getId(), true); ++ ++ // Cache the result if caching is enabled and data was fetched successfully ++ if (org.dreeam.leaf.config.modules.misc.CacheProfileLookup.enabled && fetchedResult != null) { ++ PROFILE_DATA_CACHE.put(targetProfile.getId(), fetchedResult); ++ } ++ ++ return fetchedResult; ++ } ++ ++ @Override ++ public boolean hasTextures() { ++ return this.profile.getProperties().containsKey("textures"); ++ } ++ // Leaf end - cache profile data ++ + private static void copyProfileProperties(GameProfile source, GameProfile target) { + copyProfileProperties(source, target, false); + } diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java deleted file mode 100644 index d7d6e7fc..00000000 --- a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/Cache.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.dreeam.leaf.config.modules.misc; - -import org.dreeam.leaf.config.ConfigModules; -import org.dreeam.leaf.config.EnumConfigCategory; - -public class Cache extends ConfigModules { - - public String getBasePath() { - return EnumConfigCategory.MISC.getBaseKeyName() + ".cache"; - } - - public static boolean cachePlayerProfileResult = false; - public static int cachePlayerProfileResultTimeout = 1440; - - @Override - public void onLoaded() { - cachePlayerProfileResult = config.getBoolean(getBasePath() + ".cache-player-profile-result", cachePlayerProfileResult, config.pickStringRegionBased(""" - Cache the player profile result on they first join. - It's useful if Mojang's verification server is down.""", - """ - 玩家首次加入时缓存 PlayerProfile. - 正版验证服务器宕机时非常有用.""")); - cachePlayerProfileResultTimeout = config.getInt(getBasePath() + ".cache-player-profile-result-timeout", cachePlayerProfileResultTimeout, - config.pickStringRegionBased( - "The timeout of the cache. Unit: Minutes.", - "缓存过期时间. 单位: 分钟." - )); - } -} diff --git a/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/CacheProfileLookup.java b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/CacheProfileLookup.java new file mode 100644 index 00000000..c21c107b --- /dev/null +++ b/leaf-server/src/main/java/org/dreeam/leaf/config/modules/misc/CacheProfileLookup.java @@ -0,0 +1,31 @@ +package org.dreeam.leaf.config.modules.misc; + +import org.dreeam.leaf.config.ConfigModules; +import org.dreeam.leaf.config.EnumConfigCategory; + +public class CacheProfileLookup extends ConfigModules { + + public String getBasePath() { + return EnumConfigCategory.MISC.getBaseKeyName() + ".cache.profile-lookup"; + } + + public static boolean enabled = false; + public static int timeout = 1440; // 24 hours in minutes + public static int maxSize = 8192; + + @Override + public void onLoaded() { + enabled = config.getBoolean(getBasePath() + ".enabled", enabled, config.pickStringRegionBased(""" + Cache profile data lookups (skins, textures, etc.) to reduce API calls to Mojang.""", + """ + 缓存玩家资料查询 (皮肤, 材质等) 以减少对 Mojang API 的调用.""")); + timeout = config.getInt(getBasePath() + ".timeout", timeout, config.pickStringRegionBased( + "The timeout for profile lookup cache. Unit: Minutes.", + "玩家资料查询缓存过期时间. 单位: 分钟. (推荐: 1440 = 24小时)" + )); + maxSize = config.getInt(getBasePath() + ".max-size", maxSize, config.pickStringRegionBased( + "Maximum number of profiles to cache. Higher values use more memory (not that much).", + "最大缓存的玩家资料数量. 更高的值会使用更多内存." + )); + } +}