aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-04-14 01:17:20 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-04-14 01:17:20 +0800
commit7703819d0b252f9d209d378176a225f561c1f90b (patch)
treee733f9fe633ed4880f2b6a168ba4c757f9ad4719 /src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
parent71dde4ea55fd0833ab2eaecbe893617cb24682a1 (diff)
downloadRoughlyEnoughItems-7703819d0b252f9d209d378176a225f561c1f90b.tar.gz
RoughlyEnoughItems-7703819d0b252f9d209d378176a225f561c1f90b.tar.bz2
RoughlyEnoughItems-7703819d0b252f9d209d378176a225f561c1f90b.zip
Fix #58 + Bump Version
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
index 1bb10b0a4..5b8c319b9 100644
--- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
@@ -189,7 +189,7 @@ public class RecipeViewingScreen extends Screen {
return Optional.ofNullable(I18n.translate("text.rei.previous_page"));
}
});
- widgets.add(new ClickableLabelWidget((int) bounds.getCenterX(), (int) bounds.getY() + 23, "") {
+ widgets.add(new ClickableLabelWidget((int) bounds.getCenterX(), (int) bounds.getY() + 23, "", categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight()) {
@Override
public void render(int mouseX, int mouseY, float delta) {
this.text = String.format("%d/%d", page + 1, getTotalPages(selectedCategory));
@@ -222,9 +222,7 @@ public class RecipeViewingScreen extends Screen {
return Optional.ofNullable(I18n.translate("text.rei.next_page"));
}
});
- int recipesPerPageByHeight = getRecipesPerPageByHeight();
- recipeBack.enabled = recipeNext.enabled = categoriesMap.get(selectedCategory).size() > recipesPerPageByHeight;
-
+ recipeBack.enabled = recipeNext.enabled = categoriesMap.get(selectedCategory).size() > getRecipesPerPageByHeight();
for(int i = 0; i < 6; i++) {
int j = i + categoryPages * 6;
if (categories.size() > j) {
@@ -317,9 +315,7 @@ public class RecipeViewingScreen extends Screen {
fill(bounds.x + 17, bounds.y + 5, bounds.x + bounds.width - 17, bounds.y + 17, SUB_COLOR.getRGB());
fill(bounds.x + 17, bounds.y + 21, bounds.x + bounds.width - 17, bounds.y + 33, SUB_COLOR.getRGB());
}
- tabs.stream().filter(tabWidget ->
- !tabWidget.isSelected()
- ).forEach(tabWidget -> tabWidget.render(mouseX, mouseY, delta));
+ tabs.stream().filter(tabWidget -> !tabWidget.isSelected()).forEach(tabWidget -> tabWidget.render(mouseX, mouseY, delta));
GuiLighting.disable();
super.render(mouseX, mouseY, delta);
widgets.forEach(widget -> {