mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2026-01-06 15:51:31 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b0da38c2 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939) PaperMC/Paper@1922be90 Update custom tags (#12183) PaperMC/Paper@79cf1353 Ignore HopperInventorySearchEvent when it has no listeners (#13009) PaperMC/Paper@ea014f7a feat: add stuckEntityPoiRetryDelay config (#12949) PaperMC/Paper@a9e76749 Support for showNotification in PlayerRecipeDiscoverEvent (#12992) PaperMC/Paper@5622c9dd Expose attribute sentiment (#12974) PaperMC/Paper@42b653b1 Expose more argument types (#12665) PaperMC/Paper@52d9a221 [ci/skip] Fix typo in Display javadoc (#13010) PaperMC/Paper@614e9acf Improve APIs around riptide tridents (#12996) PaperMC/Paper@51706e5a Fixed DyeItem sheep dye hunk
33 lines
1.8 KiB
Diff
33 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Taiyou06 <kaandindar21@gmail.com>
|
|
Date: Fri, 8 Nov 2024 00:06:34 +0100
|
|
Subject: [PATCH] Lithium: cached iterate outwards
|
|
|
|
By: 2No2Name <2No2Name@web.de>
|
|
As part of: Lithium (https://github.com/CaffeineMC/lithium)
|
|
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
|
|
|
|
diff --git a/net/minecraft/core/BlockPos.java b/net/minecraft/core/BlockPos.java
|
|
index 6518d3fff6daf331b24a7bf5b39fa1920b73711d..596a62f4020e51c2bd5a63c145b7f0e500c4b0ed 100644
|
|
--- a/net/minecraft/core/BlockPos.java
|
|
+++ b/net/minecraft/core/BlockPos.java
|
|
@@ -347,7 +347,18 @@ public class BlockPos extends Vec3i {
|
|
};
|
|
}
|
|
|
|
+ // JettPack start - lithium: cached iterate outwards
|
|
+ private static final org.dreeam.leaf.util.cache.IterateOutwardsCache ITERATE_OUTWARDS_CACHE = new org.dreeam.leaf.util.cache.IterateOutwardsCache(50);
|
|
+ private static final it.unimi.dsi.fastutil.longs.LongList HOGLIN_PIGLIN_CACHE = ITERATE_OUTWARDS_CACHE.getOrCompute(8, 4, 8);
|
|
+ // JettPack end - lithium: cached iterate outwards
|
|
+
|
|
public static Iterable<BlockPos> withinManhattan(BlockPos pos, int xSize, int ySize, int zSize) {
|
|
+ // JettPack start - lithium: cached iterate outwards
|
|
+ if (pos != org.dreeam.leaf.util.cache.IterateOutwardsCache.POS_ZERO) {
|
|
+ final it.unimi.dsi.fastutil.longs.LongList positions = xSize == 8 && ySize == 4 && zSize == 8 ? HOGLIN_PIGLIN_CACHE : ITERATE_OUTWARDS_CACHE.getOrCompute(xSize, ySize, zSize);
|
|
+ return new org.dreeam.leaf.util.cache.LongList2BlockPosMutableIterable(pos, positions);
|
|
+ }
|
|
+ // JettPack end - lithium: cached iterate outwards
|
|
int i = xSize + ySize + zSize;
|
|
int x1 = pos.getX();
|
|
int y1 = pos.getY();
|