9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2026-01-04 15:41:40 +00:00

Update reduce array allocations

This commit is contained in:
Dreeam
2025-07-25 10:22:55 +08:00
parent 006fe7ce3a
commit ffa437b4aa
4 changed files with 172 additions and 220 deletions

View File

@@ -9,7 +9,7 @@ Gale - https://galemc.org
The JMH benchmark of this patch can be found in SunBox's `RecordHashCode`
diff --git a/ca/spottedleaf/moonrise/patches/collisions/util/FluidOcclusionCacheKey.java b/ca/spottedleaf/moonrise/patches/collisions/util/FluidOcclusionCacheKey.java
index cf9ffdeff6bf0b62a45f7a44dbfe0dd7d17dc4f4..f1480625eaece1553d4a96ec54138a463a6fc1ca 100644
index cf9ffdeff6bf0b62a45f7a44dbfe0dd7d17dc4f4..fcff01c84d611a75dbf79b1644092516c7cfb0bc 100644
--- a/ca/spottedleaf/moonrise/patches/collisions/util/FluidOcclusionCacheKey.java
+++ b/ca/spottedleaf/moonrise/patches/collisions/util/FluidOcclusionCacheKey.java
@@ -3,5 +3,58 @@ package ca.spottedleaf.moonrise.patches.collisions.util;
@@ -17,7 +17,7 @@ index cf9ffdeff6bf0b62a45f7a44dbfe0dd7d17dc4f4..f1480625eaece1553d4a96ec54138a46
import net.minecraft.world.level.block.state.BlockState;
-public record FluidOcclusionCacheKey(BlockState first, BlockState second, Direction direction, boolean result) {
+// Gale start - Lithium - cache FluidOcclusionCacheKey hash
+// Gale start - cache FluidOcclusionCacheKey hash
+public final class FluidOcclusionCacheKey {
+ private final BlockState first;
+ private final BlockState second;
@@ -70,5 +70,5 @@ index cf9ffdeff6bf0b62a45f7a44dbfe0dd7d17dc4f4..f1480625eaece1553d4a96ec54138a46
+ "direction=" + direction + ", " +
+ "result=" + result + ']';
+ }
+ // Gale end - Lithium - cache FluidOcclusionCacheKey hash
+ // Gale end - cache FluidOcclusionCacheKey hash
}