diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-01-13 22:32:06 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-01-13 22:32:06 +0800 |
| commit | 55fb26865a7c77a098b2be067afcf29c335df48c (patch) | |
| tree | e801d272eeea5b5a6eeda1162dbd9b43a67a228b /src/main/java/me/shedaniel/rei/gui | |
| parent | f4473fd6c4142e071e498094490f44692dfbbdf3 (diff) | |
| download | RoughlyEnoughItems-2.0.0.37.tar.gz RoughlyEnoughItems-2.0.0.37.tar.bz2 RoughlyEnoughItems-2.0.0.37.zip | |
Guess this worksv2.0.0.37
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java index 777106f93..955c4e5d9 100644 --- a/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java +++ b/src/main/java/me/shedaniel/rei/gui/widget/RecipeViewingWidget.java @@ -3,6 +3,7 @@ package me.shedaniel.rei.gui.widget; import com.google.common.collect.Lists; import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.rei.api.IRecipeCategory; +import me.shedaniel.rei.api.IRecipeCategoryCraftable; import me.shedaniel.rei.api.IRecipeDisplay; import me.shedaniel.rei.client.ClientHelper; import me.shedaniel.rei.client.GuiHelper; @@ -177,9 +178,17 @@ public class RecipeViewingWidget extends Gui { if (page * getRecipesPerPage() < categoriesMap.get(selectedCategory).size()) { IRecipeDisplay topDisplay = categoriesMap.get(selectedCategory).get(page * getRecipesPerPage()); widgets.addAll(selectedCategory.setupDisplay(getParent(), topDisplay, new Rectangle((int) getBounds().getCenterX() - 75, getBounds().y + 40, 150, selectedCategory.usesFullPage() ? 118 : 66))); + IRecipeCategoryCraftable craftable = RecipeHelper.getCategoryCraftable(topDisplay); + if (craftable != null) + craftable.registerAutoCraftButton(widgets, new Rectangle((int) getBounds().getCenterX() - 75, getBounds().y + 40, 150, selectedCategory.usesFullPage() ? 118 : 66), + getParent(), topDisplay); if (!selectedCategory.usesFullPage() && page * getRecipesPerPage() + 1 < categoriesMap.get(selectedCategory).size()) { IRecipeDisplay middleDisplay = categoriesMap.get(selectedCategory).get(page * getRecipesPerPage() + 1); widgets.addAll(selectedCategory.setupDisplay(getParent(), middleDisplay, new Rectangle((int) getBounds().getCenterX() - 75, getBounds().y + 108, 150, 66))); + craftable = RecipeHelper.getCategoryCraftable(middleDisplay); + if (craftable != null) + craftable.registerAutoCraftButton(widgets, new Rectangle((int) getBounds().getCenterX() - 75, getBounds().y + 108, 150, 66), + getParent(), middleDisplay); } } |
