Skip to content

Commit 3ae338d

Browse files
committed
backport: fix slope node bit magic
1 parent db9de7d commit 3ae338d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

leaf-server/minecraft-patches/features/0132-Use-BFS-on-getSlopeDistance.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ index 5c1f99a8fd9920b30e6a80769bc306591510012a..7151c2a53687b4abef65c0a3da363ccd
2424
BlockState blockState = this.getBlockState(pos);
2525
FluidState fluidState = blockState.getFluidState();
2626
diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java
27-
index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..01ba0756789fcc61905bbaf1be88b526b76f2490 100644
27+
index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..5069006c609f43559cf241fd5267a1f52f7d9680 100644
2828
--- a/net/minecraft/world/level/material/FlowingFluid.java
2929
+++ b/net/minecraft/world/level/material/FlowingFluid.java
3030
@@ -341,32 +341,123 @@ public abstract class FlowingFluid extends Fluid {
@@ -110,7 +110,7 @@ index 4c2c2efd5380ff1fa5ad7553b51babae20f516ae..01ba0756789fcc61905bbaf1be88b526
110110
+ }
111111
+
112112
+ private static long encodeSlopeNode(BlockPos pos, Direction excludedDir) {
113-
+ return ((long) pos.getX() & 0xFFFFFFFFL) << 32 | ((long) pos.getZ() & 0xFFFFFFFFL) << 4 | (excludedDir.ordinal() & 0x0F);
113+
+ return ((pos.getX() & 67108863L) << 38) | ((pos.getZ() & 67108863L) << 12) | (excludedDir.ordinal() & 0x0F);
114114
+ }
115115
+
116116
+ public static class SlopeDistanceNodeDeque {

0 commit comments

Comments
 (0)