aboutsummaryrefslogtreecommitdiff
path: root/runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java b/runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java
index 02deb5231..0384a5b49 100644
--- a/runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java
+++ b/runtime/src/main/java/me/shedaniel/rei/gui/AbstractRecipeViewingScreen.java
@@ -34,6 +34,8 @@ import me.shedaniel.rei.api.util.CollectionUtils;
import me.shedaniel.rei.gui.widget.EntryWidget;
import me.shedaniel.rei.impl.ClientHelperImpl;
import net.minecraft.client.gui.chat.NarratorChatListener;
+import net.minecraft.client.gui.components.events.ContainerEventHandler;
+import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.Nullable;
@@ -118,10 +120,10 @@ public abstract class AbstractRecipeViewingScreen extends Screen implements Reci
transformNotice(Slot.OUTPUT, setupDisplay, noticeStack);
}
- private static void transformNotice(int marker, List<Widget> setupDisplay, EntryStack<?> noticeStack) {
+ private static void transformNotice(int marker, List<? extends GuiEventListener> setupDisplay, EntryStack<?> noticeStack) {
if (noticeStack.isEmpty())
return;
- for (Widget widget : setupDisplay) {
+ for (GuiEventListener widget : setupDisplay) {
if (widget instanceof EntryWidget) {
EntryWidget entry = (EntryWidget) widget;
if (entry.getNoticeMark() == marker && entry.getEntries().size() > 1) {
@@ -131,6 +133,8 @@ public abstract class AbstractRecipeViewingScreen extends Screen implements Reci
entry.entry(stack);
}
}
+ } else if (widget instanceof ContainerEventHandler) {
+ transformNotice(marker, ((ContainerEventHandler) widget).children(), noticeStack);
}
}
}