diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-08-17 17:05:59 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-08-17 17:05:59 +0800 |
| commit | 5c91a6654e697fdadde79508f3ef994936e4b952 (patch) | |
| tree | c2d47385603b038dedcba893a7242bc4c04bb5b3 /src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java | |
| parent | dab398882cd64f6152078f59ba768e4ffd437ba3 (diff) | |
| download | RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.tar.gz RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.tar.bz2 RoughlyEnoughItems-5c91a6654e697fdadde79508f3ef994936e4b952.zip | |
Finishing the auto crafting API
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/VillagerRecipeViewingScreen.java | 7 |
1 files changed, 4 insertions, 3 deletions
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<Widget> setupDisplay = category.setupDisplay(() -> display, recipeBounds); + this.widgets.addAll(setupDisplay); Optional<ButtonAreaSupplier> 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)) { |
