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

JEI transfer picks the most common ingredient #2975

Merged
merged 7 commits into from
Oct 17, 2021

Conversation

Darkere
Copy link
Collaborator

@Darkere Darkere commented May 13, 2021

When transfering items via JEI it will look up the most common item in the system and use that one instead of randomly picking.
Implements #2921

@DarkHelmet433
Copy link

This would be really, really helpful!

@necauqua
Copy link
Contributor

necauqua commented Jun 7, 2021

I played with this and my feedback is that I would also check for items that the system knows how to craft as a fallback - so if it has none of the variants it also looks up if it can craft one of them, this would help making patterns so much.

My existing scenario - making a pattern for a thing that needs blue dye, and I have a pattern to make vanilla dye from lapis, but of course I have none of it in the system.
And then there is a choice between vanilla blue dye that my system knows how to craft and some weird modded one that who knows how you need to even get that, and of course the random selection picks up that weird modded version

But at least it stopped putting dark glass in all the recipes (if I have normal glass in the system), hurray

@necauqua
Copy link
Contributor

necauqua commented Jun 9, 2021

One more thing to make it just perfect - also check player inventory for patterns, so that when player creates a whole pattern chain with JEI (very, very common thing in modpacks) it picks up the right variants all the time even if the system does not know about such items yet

@Darkere
Copy link
Collaborator Author

Darkere commented Jun 9, 2021

You know what... that is a great idea. Gonna blow peoples minds :D

Wasn't quite able to make it work for processing properly. But works for crafting recipes. Will take another look later.

@necauqua
Copy link
Contributor

necauqua commented Jun 9, 2021

I think it should prefer player patterns (like players rarely carry patterns, and when they do it's exactly because they are making chain recipes) over most items in system.

I also see that you included player items as well, this one (separately from player patterns) should not take preference over the system maybe

@raoulvdberge
Copy link
Collaborator

it picks up the right variants all the time even if the system does not know about such items yet

Doesn't this only work when you have none of all variants in the system?

If you have more of an item in your system than the pattern provides, the pattern would still be ignored.

@necauqua
Copy link
Contributor

necauqua commented Jun 10, 2021

Yes, that's exactly what I am talking about in my previous message - if player inventory has a pattern it should be preferred regardless of the system state

@Darkere
Copy link
Collaborator Author

Darkere commented Jun 12, 2021

If I'm making patterns and there is an item that already exists in the system, I think it makes more sense to use that one rather than the item from a pattern that randomly can also be used in this recipe.

More often than not I'll have plenty of these Items in the system and the recipe should use those rather than using the pattern for the special case I just made.

For a concrete example, imagine you just made a pattern for Stone Bricks. I would still want any further patterns to still use the regular stone from the system. In fact it would be pretty weird if the machine casing recipe I make after this uses stone bricks rather than stone.

@Darkere
Copy link
Collaborator Author

Darkere commented Jun 13, 2021

working nicely now :)

@necauqua
Copy link
Contributor

necauqua commented Jun 13, 2021

I got this with d797804:

exception
java.lang.UnsupportedOperationException: Crafting pattern is invalid
	at com.refinedmods.refinedstorage.apiimpl.autocrafting.InvalidCraftingPattern.getOutputs(InvalidCraftingPattern.java:58) ~[refinedstorage:1.9.13] {re:classloading}
	at com.refinedmods.refinedstorage.integration.jei.IngredientTracker.addAvailableStack(IngredientTracker.java:39) ~[refinedstorage:1.9.13] {re:classloading}
	at com.refinedmods.refinedstorage.integration.jei.GridRecipeTransferHandler.createTracker(GridRecipeTransferHandler.java:112) ~[refinedstorage:1.9.13] {re:classloading}
	at com.refinedmods.refinedstorage.integration.jei.GridRecipeTransferHandler.transferRecipeForCraftingGrid(GridRecipeTransferHandler.java:62) ~[refinedstorage:1.9.13] {re:classloading}
	at com.refinedmods.refinedstorage.integration.jei.GridRecipeTransferHandler.transferRecipe(GridRecipeTransferHandler.java:53) ~[refinedstorage:1.9.13] {re:classloading}
	at com.refinedmods.refinedstorage.integration.jei.GridRecipeTransferHandler.transferRecipe(GridRecipeTransferHandler.java:29) ~[refinedstorage:1.9.13] {re:classloading}
	at mezz.jei.transfer.RecipeTransferUtil.transferRecipe(RecipeTransferUtil.java:61) ~[jei:7.7.0.100]

It was a ctrl-click to autocraft missing thing

@Darkere
Copy link
Collaborator Author

Darkere commented Jun 13, 2021

oh yeah good catch. fixed.

@NielsPilgaard
Copy link

This feature would be greatly appreciated by many players, I hope you can find time at some point to review/merge this :x

@raoulvdberge
Copy link
Collaborator

Hi, I'm currently on vacation. I'll take a look at this next week.

@Darkere Darkere merged commit 8eee814 into refinedmods:mc1.16 Oct 17, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants