emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
220 stars 45 forks source link

Ensure that EmiRecipeHandler#craft automatically returns to the previous screen #581

Closed raoulvdberge closed 4 days ago

raoulvdberge commented 1 week ago

Currently, I need to do something like this myself:

    @Override
    public boolean craft(final EmiRecipe recipe, final EmiCraftContext<CraftingGridContainerMenu> context) {
        final List<List<ItemResource>> inputs = recipe.getInputs()
            .stream()
            .map(this::getStacks)
            .toList();
        context.getScreenHandler().transferRecipe(inputs);
        Minecraft.getInstance().setScreen(context.getScreen());
        return true;
    }
emilyploszaj commented 4 days ago

This was adjusted in 1.1.8