Refactor JEI description, add support for fluids#382
Open
Wizzerinus wants to merge 1 commit intoCleanroomMC:masterfrom
Open
Refactor JEI description, add support for fluids#382Wizzerinus wants to merge 1 commit intoCleanroomMC:masterfrom
Wizzerinus wants to merge 1 commit intoCleanroomMC:masterfrom
Conversation
WaitingIdly
requested changes
Apr 11, 2026
| VanillaTypes.ITEM, | ||
| entry.getRight().toArray(new String[0])); | ||
| for (DescriptionEntry<?> entry : this.getScriptedRecipes()) { | ||
| System.out.println("adding entry: " + entry); |
| for (Pair<List<IIngredient>, List<String>> entry : this.getBackupRecipes()) { | ||
| if (entry.getKey() | ||
| for (DescriptionEntry<?> entry : this.getBackupRecipes()) { | ||
| System.out.println("removing entry: " + entry); |
| @MethodDescription(type = MethodDescription.Type.ADDITION) | ||
| public void add(List<IIngredient> target, List<String> description) { | ||
| addScripted(Pair.of(target, description)); | ||
| public void add(IIngredient[] target, String... description) { |
Collaborator
There was a problem hiding this comment.
maybe do Object[] target + get the IIngredientRegistry#getIngredientType later on + check that everything has the same ingredient type. wouldnt use IIngredient or FluidStack anymore
| } | ||
|
|
||
| private boolean compareObjects(Object inEntry, Object inRegistry) { | ||
| if (inEntry instanceof ItemStack ieStack) { |
Collaborator
There was a problem hiding this comment.
since this happens only in applyRemovals, we can compare using IIngredientHelper#getUniqueId - perhaps IngredientUtil#equal? although i think that might be intended for internal logic.
| entry.getRight().toArray(new String[0])); | ||
| for (DescriptionEntry<?> entry : this.getScriptedRecipes()) { | ||
| System.out.println("adding entry: " + entry); | ||
| if (entry.representative instanceof ItemStack) { |
Collaborator
There was a problem hiding this comment.
would suggest ensuring everything is the same IIngredientRegistry#getIngredientType + registering via that (casting as needed. shouldnt need an instanceof then
| public class Description extends VirtualizedRegistry<Pair<List<IIngredient>, List<String>>> { | ||
| public class Description extends VirtualizedRegistry<Description.DescriptionEntry<?>> { | ||
|
|
||
| static class DescriptionEntry<T> { |
Collaborator
There was a problem hiding this comment.
think this needs public
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allows using
fluid(...)inmods.jei.description, which also fixes a startup crash when the code does thatThis should support adding more types fairly easily
lmk if this is a bad approach, I was kinda very focused on keeping it a VirtualizedRegistry, and its probably not the cleanest way