Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SquidDev opened this issue Jun 4, 2021 · 0 comments
Open

Comments

@SquidDev
Copy link

SquidDev commented Jun 4, 2021

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:

public void add(Object... component) {
Arrays.stream(component).filter(this::accepts).forEach(inventoryComponent -> {
this.inventoryHandlers.add((InventoryComponent<T>) inventoryComponent);
rebuildCapability(FacingUtil.Sideness.values());
});
}

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant