aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-02-26 00:35:20 +0800
committershedaniel <daniel@shedaniel.me>2020-02-26 00:35:20 +0800
commit69a855f33483c3a5273f6f337c95fb51aad5d2b4 (patch)
tree8cec3c7967d95ec386bcf4aabe59b323b23f1103 /src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
parent6a943e21ed3c2610ade20c3ba0646da87db65501 (diff)
downloadRoughlyEnoughItems-69a855f33483c3a5273f6f337c95fb51aad5d2b4.tar.gz
RoughlyEnoughItems-69a855f33483c3a5273f6f337c95fb51aad5d2b4.tar.bz2
RoughlyEnoughItems-69a855f33483c3a5273f6f337c95fb51aad5d2b4.zip
improved notice filtering
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
index 133827ee2..10f2d21f6 100644
--- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java
@@ -40,7 +40,7 @@ import java.util.Map;
import java.util.Optional;
@ApiStatus.Internal
-public class VillagerRecipeViewingScreen extends Screen {
+public class VillagerRecipeViewingScreen extends Screen implements StackToNoticeScreen {
private final Map<RecipeCategory<?>, List<RecipeDisplay>> categoryMap;
private final List<RecipeCategory<?>> categories;
@@ -60,7 +60,8 @@ public class VillagerRecipeViewingScreen extends Screen {
private long scrollBarAlphaFutureTime = -1;
private boolean draggingScrollBar;
private int tabsPage;
- private EntryStack mainStackToNotice = EntryStack.empty();
+ private EntryStack ingredientStackToNotice = EntryStack.empty();
+ private EntryStack resultStackToNotice = EntryStack.empty();
public VillagerRecipeViewingScreen(Map<RecipeCategory<?>, List<RecipeDisplay>> map) {
super(new LiteralText(""));
@@ -85,8 +86,14 @@ public class VillagerRecipeViewingScreen extends Screen {
});
}
- public void addMainStackToNotice(EntryStack stack) {
- this.mainStackToNotice = stack;
+ @Override
+ public void addIngredientStackToNotice(EntryStack stack) {
+ ingredientStackToNotice = stack;
+ }
+
+ @Override
+ public void addResultStackToNotice(EntryStack stack) {
+ resultStackToNotice = stack;
}
@Override
@@ -138,7 +145,8 @@ public class VillagerRecipeViewingScreen extends Screen {
Rectangle recipeBounds = new Rectangle(bounds.x + 100 + (guiWidth - 100) / 2 - category.getDisplayWidth(display) / 2, bounds.y + bounds.height / 2 - category.getDisplayHeight() / 2, category.getDisplayWidth(display), category.getDisplayHeight());
List<Widget> setupDisplay = category.setupDisplay(() -> display, recipeBounds);
- RecipeViewingScreen.transformNotice(setupDisplay, mainStackToNotice);
+ RecipeViewingScreen.transformIngredientNotice(setupDisplay, ingredientStackToNotice);
+ RecipeViewingScreen.transformResultNotice(setupDisplay, resultStackToNotice);
this.widgets.addAll(setupDisplay);
Optional<ButtonAreaSupplier> supplier = RecipeHelper.getInstance().getAutoCraftButtonArea(category);
if (supplier.isPresent() && supplier.get().get(recipeBounds) != null)