From 5c91a6654e697fdadde79508f3ef994936e4b952 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 17 Aug 2019 17:05:59 +0800 Subject: Finishing the auto crafting API --- .../java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java') diff --git a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java index 6a4cfe2e9..3485e56d8 100644 --- a/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java @@ -12,9 +12,9 @@ import com.zeitheron.hammercore.client.utils.Scissors; import me.shedaniel.cloth.api.ClientUtils; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.*; -import me.shedaniel.rei.impl.ScreenHelper; import me.shedaniel.rei.gui.renderers.RecipeRenderer; import me.shedaniel.rei.gui.widget.*; +import me.shedaniel.rei.impl.ScreenHelper; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.Element; import net.minecraft.client.gui.screen.Screen; @@ -128,10 +128,11 @@ public class VillagerRecipeViewingScreen extends Screen { this.widgets.add(new SlotBaseWidget(scrollListBounds)); 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()); - this.widgets.addAll(category.setupDisplay(() -> display, recipeBounds)); + List setupDisplay = category.setupDisplay(() -> display, recipeBounds); + this.widgets.addAll(setupDisplay); Optional supplier = RecipeHelper.getInstance().getSpeedCraftButtonArea(category); if (supplier.isPresent() && supplier.get().get(recipeBounds) != null) - this.widgets.add(new AutoCraftingButtonWidget(supplier.get().get(recipeBounds), supplier.get().getButtonText(), () -> display)); + this.widgets.add(new AutoCraftingButtonWidget(supplier.get().get(recipeBounds), supplier.get().getButtonText(), () -> display, setupDisplay)); int index = 0; for (RecipeDisplay recipeDisplay : categoryMap.get(category)) { -- cgit