EMI

EMI

14M Downloads

[Forge-1.20.1] `RecipeFillerHandler`s added for menus that extend `InventoryMenu` have no effect

thelegitdolt opened this issue ยท 0 comments

commented

Quark backpacks are one such example.
This is an excerpt from RecipeFillerHandler::getAllHandlers.

T screenHandler = screen.getMenu();
MenuType<?> type;
try {
	type = screenHandler instanceof InventoryMenu ? null : screenHandler.getType();
} catch (UnsupportedOperationException e) {
	type = null;
}
if ((type != null || screenHandler instanceof InventoryMenu) && handlers.containsKey(type)) {
	return (List<EmiRecipeHandler<T>>) (List<?>) handlers.get(type);
}

The menu defaults to null if it is instanceof InventoryMenu, ignoring any potential entries in the handlers map. To fix this, there should be a check to see if the menu is present in handlers map first.