Skip to content

Commit 09a8ee5

Browse files
committed
make RecipeMemorySlot a jei ingredient provider
1 parent a0cb66b commit 09a8ee5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/gregtech/common/mui/widget/workbench/RecipeMemorySlot.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010

1111
import com.cleanroommc.modularui.api.drawable.IKey;
1212
import com.cleanroommc.modularui.api.widget.Interactable;
13+
import com.cleanroommc.modularui.integration.jei.JeiIngredientProvider;
1314
import com.cleanroommc.modularui.screen.RichTooltip;
1415
import com.cleanroommc.modularui.screen.viewport.ModularGuiContext;
1516
import com.cleanroommc.modularui.theme.WidgetTheme;
1617
import com.cleanroommc.modularui.utils.MouseData;
1718
import com.cleanroommc.modularui.widget.Widget;
1819
import org.jetbrains.annotations.NotNull;
20+
import org.jetbrains.annotations.Nullable;
1921

20-
public class RecipeMemorySlot extends Widget<RecipeMemorySlot> implements Interactable {
22+
public class RecipeMemorySlot extends Widget<RecipeMemorySlot> implements Interactable, JeiIngredientProvider {
2123

2224
private final CraftingRecipeMemory memory;
2325
private final int index;
@@ -87,4 +89,10 @@ public Result onMousePressed(int mouseButton) {
8789

8890
return Result.ACCEPT;
8991
}
92+
93+
@Override
94+
public @Nullable Object getIngredient() {
95+
if (!this.memory.hasRecipe(this.index)) return null;
96+
return this.memory.getRecipeOutputAtIndex(this.index);
97+
}
9098
}

0 commit comments

Comments
 (0)