Skip to content

Commit 21b4930

Browse files
committed
Fix diff in FlowingFluid#canPassThroughWall
The function should not be returning false if the block states are uncachable.
1 parent e0ba395 commit 21b4930

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

paper-server/patches/features/0001-Moonrise-optimisation-patches.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34017,7 +34017,7 @@ index ca23af013967b50420ebee178878ea79333de53b..d41b9266625ca6c5e32c5126f35a1f77
3401734017

3401834018
public int getLightSectionCount() {
3401934019
diff --git a/net/minecraft/world/level/material/FlowingFluid.java b/net/minecraft/world/level/material/FlowingFluid.java
34020-
index a3e379ec92e38107d7ebde9c67ec129da52a547a..083083172a4be961ac25ead7ac61a10a71b2c919 100644
34020+
index a3e379ec92e38107d7ebde9c67ec129da52a547a..482bbb50b7f4b19813c1043228701da54d850064 100644
3402134021
--- a/net/minecraft/world/level/material/FlowingFluid.java
3402234022
+++ b/net/minecraft/world/level/material/FlowingFluid.java
3402334023
@@ -46,6 +46,48 @@ public abstract class FlowingFluid extends Fluid {
@@ -34069,7 +34069,7 @@ index a3e379ec92e38107d7ebde9c67ec129da52a547a..083083172a4be961ac25ead7ac61a10a
3406934069
@Override
3407034070
protected void createFluidStateDefinition(StateDefinition.Builder<Fluid, FluidState> builder) {
3407134071
builder.add(FALLING);
34072-
@@ -210,65 +252,73 @@ public abstract class FlowingFluid extends Fluid {
34072+
@@ -210,65 +252,71 @@ public abstract class FlowingFluid extends Fluid {
3407334073
}
3407434074
}
3407534075

@@ -34123,13 +34123,13 @@ index a3e379ec92e38107d7ebde9c67ec129da52a547a..083083172a4be961ac25ead7ac61a10a
3412334123
- map.removeLastByte();
3412434124
- }
3412534125
+ final ca.spottedleaf.moonrise.patches.collisions.util.FluidOcclusionCacheKey[] cache = ((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)fromState).moonrise$hasCache() & ((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)toState).moonrise$hasCache() ?
34126-
+ COLLISION_OCCLUSION_CACHE.get() : null;
34126+
+ COLLISION_OCCLUSION_CACHE.get() : null;
3412734127

3412834128
- map.putAndMoveToFirst(blockStatePairKey, (byte)(flag ? 1 : 0));
3412934129
- }
3413034130
+ final int keyIndex
34131-
+ = (((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)fromState).moonrise$uniqueId1() ^ ((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)toState).moonrise$uniqueId2() ^ ((ca.spottedleaf.moonrise.patches.collisions.util.CollisionDirection)(Object)direction).moonrise$uniqueId())
34132-
+ & (COLLISION_OCCLUSION_CACHE_SIZE - 1);
34131+
+ = (((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)fromState).moonrise$uniqueId1() ^ ((ca.spottedleaf.moonrise.patches.collisions.block.CollisionBlockState)toState).moonrise$uniqueId2() ^ ((ca.spottedleaf.moonrise.patches.collisions.util.CollisionDirection)(Object)direction).moonrise$uniqueId())
34132+
+ & (COLLISION_OCCLUSION_CACHE_SIZE - 1);
3413334133

3413434134
- return flag;
3413534135
- }
@@ -34138,8 +34138,8 @@ index a3e379ec92e38107d7ebde9c67ec129da52a547a..083083172a4be961ac25ead7ac61a10a
3413834138
+ if (cached != null && cached.first() == fromState && cached.second() == toState && cached.direction() == direction) {
3413934139
+ return cached.result();
3414034140
}
34141-
} else {
34142-
return false;
34141+
- } else {
34142+
- return false;
3414334143
}
3414434144
+
3414534145
+ final VoxelShape shape1 = fromState.getCollisionShape(level, fromPos);

0 commit comments

Comments
 (0)