aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2019-12-12 22:06:26 +0800
committershedaniel <daniel@shedaniel.me>2019-12-12 22:06:26 +0800
commitcbfc32fa44fec1ed91c7ff811a4755a504c46082 (patch)
treed8bf9030a60111dad2e6932d08241f46206f1b17 /src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
parent652c00c4017223fa02d63eba474ba35faa3e12c9 (diff)
downloadRoughlyEnoughItems-cbfc32fa44fec1ed91c7ff811a4755a504c46082.tar.gz
RoughlyEnoughItems-cbfc32fa44fec1ed91c7ff811a4755a504c46082.tar.bz2
RoughlyEnoughItems-cbfc32fa44fec1ed91c7ff811a4755a504c46082.zip
3.2.19
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
index 1b42f991b..f2309588b 100644
--- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
@@ -61,10 +61,10 @@ public class RecipeViewingScreen extends Screen {
this.bounds = new Rectangle(window.getScaledWidth() / 2 - guiWidth / 2, window.getScaledHeight() / 2 - guiHeight / 2, 176, 186);
this.categoriesMap = categoriesMap;
this.categories = Lists.newArrayList();
- RecipeHelper.getInstance().getAllCategories().forEach(category -> {
+ for (RecipeCategory<?> category : RecipeHelper.getInstance().getAllCategories()) {
if (categoriesMap.containsKey(category))
categories.add(category);
- });
+ }
this.selectedCategory = (RecipeCategory<RecipeDisplay>) categories.get(0);
this.tabs = new ArrayList<>();
this.choosePageActivated = false;
@@ -361,12 +361,12 @@ public class RecipeViewingScreen extends Screen {
if (selectedCategory.getFixedRecipesPerPage() > 0)
return selectedCategory.getFixedRecipesPerPage() - 1;
int height = selectedCategory.getDisplayHeight();
- return MathHelper.clamp(MathHelper.floor(((double) largestHeight - 40d) / ((double) height + 7d)) - 1, 0, Math.min(ConfigManager.getInstance().getConfig().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
+ return MathHelper.clamp(MathHelper.floor(((double) largestHeight - 40d) / ((double) height + 7d)) - 1, 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
}
private int getRecipesPerPageByHeight() {
int height = selectedCategory.getDisplayHeight();
- return MathHelper.clamp(MathHelper.floor(((double) guiHeight - 40d) / ((double) height + 7d)), 0, Math.min(ConfigManager.getInstance().getConfig().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
+ return MathHelper.clamp(MathHelper.floor(((double) guiHeight - 40d) / ((double) height + 7d)), 0, Math.min(ConfigObject.getInstance().getMaxRecipePerPage() - 1, selectedCategory.getMaximumRecipePerPage() - 1));
}
@Override