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

[Quilt 1.20.1] Incompatibility with Visual Workbench mod #20

Closed CarlMichaelFabe closed 8 months ago

CarlMichaelFabe commented 8 months ago

This is the mod in question: https://modrinth.com/mod/visual-workbench

When the crafting table is empty, changing tabs to it works normally.

But when you put an item inside the workbench, it bugs out. With the item inside the workbench, switching to another tab and switching back to the workbench gets the tabs stuck and you can't click on any tabs anymore.

https://github.com/sisby-folk/inventory-tabs/assets/116660522/293d8761-4b24-4f75-9e7e-412fde90fe0e

sisby-folk commented 8 months ago

Visual workbench registers a block entity for crafting benches, meaning they're no longer unique per type - so swap the provider should be changed to inventory_tabs:block_simple.

The proper issue is here in inventory-tabs (yarn):

image

and here in visualworkbench (moj):

image

by the time updateSlotStacks is called (after the constructor), the revision of the screen is already 10, instead of 1, because each individual slot has been set in a way that increments the revision, instead of all slots being set at once.

This is resolvable on visual workbench's side so feel free to alert them there (they just need to not end up at rev 10 - which I think they might like to do, as it matches vanilla containers), but we should be able to implement a workaround on our side as well by checking if the screen is freshly constructed.

sisby-folk commented 8 months ago

workaround implemented in 1.1.3:

https://github.com/sisby-folk/inventory-tabs/assets/55819817/30d774e2-9069-4ef8-aaa5-1e3a70e4d11e

CarlMichaelFabe commented 8 months ago

Thank you for the fix!