emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
237 stars 46 forks source link

[1.19.2] IC2Classic StackCrafting support #352

Closed CrossVas closed 9 months ago

CrossVas commented 9 months ago

Currently EMI doesn't work well with IC2Classic's StackCrafting recipes.

Actual recipe

*displayed by JEI & REI image

Recipe shown by EMI

image

Flamarine commented 9 months ago

this should be done on the ic2c side rather than the emi side ig?

CrossVas commented 9 months ago

this should be done on the ic2c side rather than the emi side ig?

Didn't mention from the beginning, but the upper image is from JEI & REI, they work just fine (I hate comparing mods, but I have no choice in this case).

EDIT: And afaik they didn't do anything special in order to handle these recipes nor did the IC2Classic. They just work.

Flamarine commented 9 months ago

this should be done on the ic2c side rather than the emi side ig?

Didn't mention from the beginning, but the upper image is from JEI & REI, they work just fine (I hate comparing mods, but I have no choice in this case).

EDIT: And afaik they didn't do anything special in order to handle these recipes nor did the IC2Classic. They just work.

it's ic2c itself that adds compat, not jei or rei

CrossVas commented 9 months ago

it's ic2c itself that adds compat, not jei or rei

IC2Classic adds 0 compat for JEI/REI on this. JEI/REI work out of the box. I was just wondering if the main dev could take a look on how they do it and add support too. It would be much appreciated.

Flamarine commented 9 months ago

it's ic2c itself that adds compat, not jei or rei

IC2Classic adds 0 compat for JEI/REI on this. JEI/REI work out of the box. I was just wondering if the main dev could take a look on how they do it and add support too. It would be much appreciated.

it's builtin in that mod and since IC2C is closed source, you cannot actually see it

Speiger commented 9 months ago

o/ @Flamarine IC2Classic dev here.

First of all the API you are talking about is open source on the IC2Classic repo, and that is all you need.
Because we have to return "ingredients" at some point anyways.

And i assume you use the "ingredients" from the Recipe class for displaying the items that should be used in the input. Fun fact: Ingredients can have ItemStack instances, and JEI/REI simply use these ItemStack instances and AT MOST copy them.

That means any Ingredient they use automatically supports stacksize visualization. In other words you have special code in your recipe viewer that removes the stacksize of the item or you are using a reverse search to see which items are part of the ingredient instead of using the (Mojangmaps 1.19.2) Ingredient#getItems function.

So yeah this is not a IC2Classic issue but a EMI issue.

And fun fact even if you disable the JEI plugin in IC2Classic, JEI stuff still works fine even with stacksize because the Recipe class from Mojang has stacksize support inferred.

Anyways, its a legit bugreport.

Flamarine commented 9 months ago

o/ @Flamarine IC2Classic dev here.

First of all the API you are talking about is open source on the IC2Classic repo, and that is all you need.
Because we have to return "ingredients" at some point anyways.

And i assume you use the "ingredients" from the Recipe class for displaying the items that should be used in the input. Fun fact: Ingredients can have ItemStack instances, and JEI/REI simply use these ItemStack instances and AT MOST copy them.

That means any Ingredient they use automatically supports stacksize visualization. In other words you have special code in your recipe viewer that removes the stacksize of the item or you are using a reverse search to see which items are part of the ingredient instead of using the (Mojangmaps 1.19.2) Ingredient#getItems function.

So yeah this is not a IC2Classic issue but a EMI issue.

And fun fact even if you disable the JEI plugin in IC2Classic, JEI stuff still works fine even with stacksize because the Recipe class from Mojang has stacksize support inferred.

Anyways, its a legit bugreport.

wow, got it.

Speiger commented 9 months ago

Also i am toying with the idea of making a open source implementation out of stacksize recipes anyways since i got so many requests.

So this will be a good fix before you get rushed reports from everywhere.

emilyploszaj commented 9 months ago

This is related to an ingredient parsing error. Now if all stacks in an ingredient have the same size, it'll use that amount instead of 1 as of 1.0.28

Speiger commented 9 months ago

@emilyploszaj thank you for the fix!