InnovativeOnlineIndustries / Titanium

Other
8 stars 23 forks source link

[1.16] MultiInventoryComponent does not rebuild the `null`/internal side #89

Open SquidDev opened 3 years ago

SquidDev commented 3 years ago

Forge's capabilities support fetching a capability instance for the "null" side. In the case of inventories, this is generally defined to return the "whole" inventory of a tile (rather than a subset of slots like other sides do).

However, Titanium's MultiInventoryComponent implementation always returns an empty LazyOptional. From my reading of the code, this is because the add method only rebuilds the lookup for the cardinal directions, and not the null side:

https://github.com/InnovativeOnlineIndustries/Titanium/blob/279f6818c3760779ab1556874abb14c0d97f96cc/src/main/java/com/hrznstudio/titanium/component/inventory/MultiInventoryComponent.java#L44-L49

This means that mods which use getCapability(ITEM_HANDLER_CAPABILITY) (rather than getCapability(ITEM_HANDLER_CAPABILITY, side) will not be able to insert into Titanium's inventories.