Shoulder Surfing Reloaded

Shoulder Surfing Reloaded

2M Downloads

[Suggestion] Replace `ClipContext.Block.COLLIDER` with `ClipContext.Block.VISUAL`

70CentsApple opened this issue · 1 comments

commented

Currently, the mod also collides with perspectives when encountering blocks such as glass, while in newer versions of Minecraft, the perspective does not collide with blocks such as glass.

The way to fix this is really simple, replace ClipContext.Block.COLLIDER with ClipContext.Block.VISUAL here.

ClipContext context = new ClipContext(from, to, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, camera.getEntity());

The definition of and difference between COLLIDER and VISUAL are shown below:
1.20.1: net.minecraft.world.level.ClipContext
image

This little fix might not bring significant changes, but it fixes mods that modify camera collisions of blocks by modifying the BlockBehaviour.BlockStateBase::getVisualShape method (such as mine, Modify Camera Collision).

I could make a PR for this issue, but if there's any reason why I shouldn't, please let me know.

commented

Thanks for the pointer! Feel free to make a PR.