Skip to content

Make recipe viewer slots more generic and fix some emi stuff#11

Open
gustovafing wants to merge 11 commits intobrachy84:recipeviewersfrom
gustovafing:recipeviewers
Open

Make recipe viewer slots more generic and fix some emi stuff#11
gustovafing wants to merge 11 commits intobrachy84:recipeviewersfrom
gustovafing:recipeviewers

Conversation

@gustovafing
Copy link
Copy Markdown
Contributor

@gustovafing gustovafing commented May 4, 2026

Adds a RecipeViewerSlotWidget class which represents a recipe viewer slot. RecipeViewerSlotWidget.create() creates the appropriate subclass of RecipeViewerSlotWidget for the currently loaded recipe viewer.

Also allows the text widget to get its component from a supplier, to allow for dynamic components to be used as text widgets.

Comment thread src/main/java/brachy/modularui/integration/emi/EmiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/emi/EmiRecipeViewerSlot.java Outdated
}

private void rebuildEmiSlot() {
if (value instanceof ItemEntryList itemEntryList) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this hardcoded to items and fluids?

Comment thread src/main/java/brachy/modularui/integration/emi/EmiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/emi/EmiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/rei/ReiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/jei/JeiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/jei/JeiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/integration/jei/JeiRecipeViewerSlot.java Outdated
Comment thread src/main/java/brachy/modularui/widgets/TextWidget.java Outdated
return new EmiRecipeViewerSlot();
} else if (ModularUI.Mods.JEI.isLoaded()) {
return new JeiRecipeViewerSlot();
} else {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still no explicit REI check?
Also, REI overrides JEI completely if it's loaded but still "loads" "jei" if the plugin compat addon is installed, so the check order should be EMI -> REI -> JEI.

renderer.setSimulate(true);
renderer.draw(null, this.key);
// Don't update the key here, otherwise an infinite loop of checkComponentUpdated -> simulate -> checkComponentUpdated occurs
renderer.draw(null, key);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
renderer.draw(null, key);
renderer.draw(null, this.key);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants