-
Notifications
You must be signed in to change notification settings - Fork 20
Features
Martijn Muijsers edited this page Jun 28, 2026
·
10 revisions
All included features are listed below.
Features originating from other projects are carefully verified and updated as part of Gale.
-
Allocate zero or one block destruction packets (original by vytskalt)
Leaf:Reduce-block-destruction-packet-allocations.patch -
Cache Identifier toString and hashCode (original by OverwriteMC)
Lazily cacheIdentifiertoString()andhashCode().
Leaf:Cache-identifier-toString-and-hash.patch -
Cache world generator sea level (original by jaskarth)
This method is potentially called for every block in the chunk, so this will save a lot of registry lookups.
Leaf:Cache-world-generator-sea-level.patch -
Check targeting range before getting visibility (original by PaulBGD)
Check targeting range before computing visibility distance, because the latter is more expensive.
Leaf:Check-targeting-range-before-getting-visibility.patch -
Check type before distance when testing targets (original by Taiyou)
Check type before computing distance, because the latter is more expensive.
Leaf: part ofOptimize-SetLookAndInteract-and-NearestVisibleLiving.patch -
Delay canSee check in entity collisions
Perform other checks beforecanSee, because the latter is more expensive.
Leaf:Reduce-canSee-work.patch -
Don't iterate over empty tick effect collections ((original by hayanesuru)
Leaf: part ofoptimize-tickEffects.patch -
Event-driven
Update (and keep cached) values or take certain actions when the underlying conditions change, instead of calculating the value or considering the action every time it is requested.- Entity#playerPassengerCount
- Mob#isLeashed
- Mob#isPersistent
- Mob#mustDespawnBecauseOfPeacefulDifficulty
- Mob#requiresCustomPersistence
- Mob#shouldDespawnInPeaceful
- Inline player UUID comparison
-
Initialize sensing with low capacity
Most mobs only ever target at most 1 entity (typically a nearby player or a mob farm bait entity)
so we create their sensing cache with an initial capacity of 2 instead of 16.
Leaf:Initialize-line-of-sight-cache-with-low-capacity.patch -
Local code optimization
Make small, localized procedures faster.-
DedicatedServer#getScaledTrackingDistance (original by hayanesuru)
Leaf:Optimize-getScaledTrackingDistance.patch -
EntityBasedExplosionDamageCalculator#getBlockExplosionResistance (reduce allocations) (original by 2No2Name)
Leaf:Reduce-lambda-and-Optional-allocation-in-EntityBased.patch -
EntityGetter#getNearestPlayer (original by Taiyou)
Leaf:Slightly-optimise-getNearestPlayer.patch -
GateBehavior#tickOrStop (remove stream) (original by Taiyou)
Leaf:Remove-stream-in-GateBehavior.patch -
LevelChunk#getBlockStateFinal(original by hayanesuru)
Leaf:optimize-LevelChunk-getBlockStateFinal.patch -
MobEffectUtil#getDigSpeedAmplification (original by Taiyou)
Leaf:Optimise-MobEffectUtil-getDigSpeedAmplification.patch -
MobSensor#checkForMobsNearby (remove stream) (original by Taiyou)
Leaf:Remove-stream-in-MobSensor.patch -
PatchedDataComponentMap#equals (original by HaHaWTH)
Leaf:Optimize-PatchedDataComponentMap-equals.patch
-
DedicatedServer#getScaledTrackingDistance (original by hayanesuru)
-
Minimize size of packed dirty synched entity data item list (original by hayanesuru)
Leaf:Optimize-SynchedEntityData-packDirty.patch -
Only update frozen ticks if changed (original by hayanesuru)
Leaf:Only-update-frozen-ticks-if-changed.patch -
Optimize entity data serializer list
MakeEntityDataSerializers#SERIALIZERSa simple list and store the index in eachEntityDataSerializerdirectly. -
Optimize global block state palette
Store the index inBlock#BLOCK_STATE_REGISTRYin eachBlockStatedirectly. -
Optimize matching item checks
Leaf:Optimize-matching-item-checks.patch -
Optimize pushable selector (original by OverwriteMC)
Avoid duplicatedBukkit#isPushablecheck, already checked inside theBukkit#canCollideWithBukkit.
Leaf:Optimize-pushable-selector.patch -
Optimize registry values
Optimize registry value to id conversion, and optimize maps that use registry values as keys. -
Optimize tag checks
Store the tags for each registry value in an efficient data structure. -
Pre-compute
Pre-compute values instead of repeatedly computing them whenever needed.
-
Enchantment#matchingSlot
Leaf: replacesRemove-stream-in-matchingSlot.patch
-
Enchantment#matchingSlot
-
Pre-compute biome fiddle table (original by hayanesuru)
Leaf: part ofcache-biome-for-mob-spawning-and-advancements.patch -
Pre-compute block state predicates (original by hayanesuru)
Pre-computes some commonly tested predicates onBlockBehaviour.
Leaf:- part of
Cache-block-state-tags.patch optimize-canHoldAnyFluid.patch- part of
optimize-getOnPos.patch optimize-isStateClimbable.patch
- part of
-
Predict Halloween
Pre-compute the epoch milliseconds for Halloween, for faster comparison.
Leaf:Predict-Halloween.patch -
Quick NearestVisibleLivingEntities entity iteration (original by Taiyou)
Leaf: part ofOptimize-SetLookAndInteract-and-NearestVisibleLiving.patch -
Reduce RandomSource instances (original by foss-mc)
Re-useRandomSourceinstances where it doesn't affect game mechanics.
Leaf:Reduce-RandomSource-instances.patch -
Minimize evaluation work
Minimize the total time cost of evaluations by re-ordering them from cheap to expensive, or delaying conditionally needed calculations until it is certain their result is required.-
RespawnAnchorBlock#explode (original by Dreeam)
ComputeinWateras late as possible.
Leaf: part ofOptimize-respawn-anchor-explosion.patch
-
RespawnAnchorBlock#explode (original by Dreeam)
-
Replace division by multiplication (original by 2No2Name)
Multiplication is faster than division in every environment.
Leaf:Replace-division-by-multiplication-in-CubePointRange.patch -
Skip Bukkit callEvent early if no listeners (original by lilingfengdev)
Leaf:Skip-event-if-no-listeners.patch -
Skip client-side code
Do not perform actions server-side if the result is only used client-side.-
Leashable#getLeashHolder (original by MrlingXD)
Leaf:Optimize-getLeashHolder.patch
-
Leashable#getLeashHolder (original by MrlingXD)
-
Skip cloning advancement criteria (original by etil2jz)
Leaf:Skip-cloning-advancement-criteria.patch -
Skip enderman teleport if requires main thread chunk load (original by PaulBGD)
Leaf:Reduce-enderman-teleport-chunk-lookups.patch -
Skip entity move if movement is zero (original by ishland)
Run a simplified version ofEntity#move()if the movement delta is zero.
Leaf:Skip-entity-move-if-movement-is-zero.patch -
Skip negligible planar movement multiplication
Skip callingEntity#getBlockSpeedFactor()fromEntity#move()when planar delta movement is negligible (within 1.0E-6 threshold).
Leaf:Skip-negligible-planar-movement-multiplication.patch -
Skip PlayerCommandSendEvent if no listeners (original by BillyGalbreath)
Leaf:Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch -
Skip canSee self check for chunk map player update (original by MrPowerGamerBR)
Skip the self check inCraftPlayer#canSeeif called fromChunkMap#updatePlayer, as it is checked already at that point.
Leaf:SparklyPaper-Optimize-canSee-checks.patch -
Sort tryAddFrost checks (original by 2No2Name)
Sort the checks inLivingEntity#tryAddFrost()in ascending order of cost.
Leaf:Check-frozen-ticks-before-landing-block.patch -
Store canSee in a fast-access format
Complement the map that backscanSeeby a packed boolean array for fast operations. -
Store despawn ranges in enum map (original by hayanesuru)
Leaf: part ofoptimize-despawn.patch -
Store mob counts in an array (original by ishland)
Leaf:Store-mob-counts-in-an-array.patch -
Store seenBy in a fast-access format
Replace theseenByset by a list (for fast iteration) and packed boolean array (for fast contains checks). -
Faster implementation for subclass
Override a superclass method with a faster implementation specific to the subclass.-
LevelChunk#getBlockStateFinal(original by hayanesuru)
Leaf: part ofoptimize-LevelChunk-getBlockStateFinal.patch
-
LevelChunk#getBlockStateFinal(original by hayanesuru)
-
Update boss bar within tick (original by jellysquid3)
Performs boss bar update code at most once per tick duringtick(), instead of every timeupdateBossbar()is called.
Leaf:Update-boss-bar-within-tick.patch -
Use fastutil collections
Useit.unimi.dsi.fastutilcollections instead of other (such asjava.util) collections.
Leaf:Replace-throttle-tracker-map-with-optimized-collecti.patch -
Use linked collections
Use linked data structures for collections that are frequently iterated over.
Leaf:Use-linked-map-for-entity-trackers.patch