sisby-folk / swingthrough

A single-mixin minecraft mod that allows hitting living entities through transparent blocks.
https://modrinth.com/mod/swingthrough
GNU Lesser General Public License v3.0
1 stars 0 forks source link

[Bug] Can't interact with blocks #2

Closed IFedor-F closed 1 year ago

IFedor-F commented 1 year ago

Can't interact with blocks in some places if there are entities behind the blocks image

sisby-folk commented 1 year ago

that's weird. should only be on blocks with an empty collision shape - I'll test barrels. what mc version?

sisby-folk commented 1 year ago

Seems like I can reproduce it on 1.20.1 by doing exactly what you've done above.

The problem is kind of a vanilla bug, kind of an us oversight - basically extending the entity raycast unconditionally means certain entities like armor stands are allowed to insist that they're closer than the block you're looking at.

So, simple solution - run the block condition earlier so that it doesn't extend the raycast range if the block isn't transparent.

image

image

Thanks for the catch! Out as 1.0.4 now.

IFedor-F commented 1 year ago

thanks!