Use isMovementBlocker() instead of isSolid() in heightmap calculation (#2822)

This commit is contained in:
Hannes Greule 2024-07-02 20:34:02 +02:00 committed by GitHub
parent 75d9475cf7
commit eedd8ee044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,19 +17,19 @@ public enum HeightMapType {
MOTION_BLOCKING { MOTION_BLOCKING {
@Override @Override
public boolean includes(BlockState state) { public boolean includes(BlockState state) {
return state.getMaterial().isSolid() || HeightMapType.hasFluid(state); return state.getMaterial().isMovementBlocker() || HeightMapType.hasFluid(state);
} }
}, },
MOTION_BLOCKING_NO_LEAVES { MOTION_BLOCKING_NO_LEAVES {
@Override @Override
public boolean includes(BlockState state) { public boolean includes(BlockState state) {
return (state.getMaterial().isSolid() || HeightMapType.hasFluid(state)) && !HeightMapType.isLeaf(state); return (state.getMaterial().isMovementBlocker() || HeightMapType.hasFluid(state)) && !HeightMapType.isLeaf(state);
} }
}, },
OCEAN_FLOOR { OCEAN_FLOOR {
@Override @Override
public boolean includes(BlockState state) { public boolean includes(BlockState state) {
return state.getMaterial().isSolid(); return state.getMaterial().isMovementBlocker();
} }
}, },
WORLD_SURFACE { WORLD_SURFACE {