sisby-folk / inventory-tabs

A minecraft mod that allows swapping to other in-world screens (blocks, entities, etc) via tabs. A fourth-generation rewrite of CakeWhip's InventoryTabs.
https://modrinth.com/mod/inventory-tabs
GNU Lesser General Public License v3.0
6 stars 3 forks source link

Block tab "can interact" raycast isn't completely accurate #40

Closed CCheukKa closed 2 months ago

CCheukKa commented 5 months ago

There seems to be some jank with inventory blocks being partially covered by non-solid blocks being considered unreachable. This bug seems to be affected by your position as well.

The setup used for testing: image

I am aiming at the yellow shulker box in all of these: image image image image

sisby-folk commented 5 months ago

The jank is simple - the mod isn't omniscient, so to check whether it thinks you can click on a block, it raycasts to 9 different spots on the block and sees if any of them hit it

https://github.com/sisby-folk/inventory-tabs/blob/1.20/src/main/java/folk/sisby/inventory_tabs/util/PlayerUtil.java

If they all miss, you miss out.

I'd be interested to know if a better solution (besides just piling on more raycasts) is even possible - false positives can cause much worse desync and lockup jank.