From 7d593ec3ab105a571f7ec04828557d406d3344d5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 19 Jun 2019 15:49:04 +0800 Subject: stuff --- .../java/me/shedaniel/rei/gui/RecipeViewingScreen.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java') diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java index c782982ac..5e01b1abc 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -39,8 +39,8 @@ public class RecipeViewingScreen extends Screen { private final List preWidgets; private final List widgets; private final List tabs; - private final Map> categoriesMap; - private final List categories; + private final Map, List> categoriesMap; + private final List> categories; public int guiWidth; public int guiHeight; public int page, categoryPages; @@ -48,10 +48,10 @@ public class RecipeViewingScreen extends Screen { public boolean choosePageActivated; public RecipeChoosePageWidget recipeChoosePageWidget; private Rectangle bounds; - private RecipeCategory selectedCategory; + private RecipeCategory selectedCategory; private ButtonWidget recipeBack, recipeNext, categoryBack, categoryNext; - public RecipeViewingScreen(Map> categoriesMap) { + public RecipeViewingScreen(Map, List> categoriesMap) { super(new TextComponent("")); this.categoryPages = 0; this.preWidgets = Lists.newArrayList(); @@ -64,7 +64,7 @@ public class RecipeViewingScreen extends Screen { if (categoriesMap.containsKey(category)) categories.add(category); }); - this.selectedCategory = categories.get(0); + this.selectedCategory = (RecipeCategory) categories.get(0); this.tabs = new ArrayList<>(); this.choosePageActivated = false; } @@ -150,7 +150,7 @@ public class RecipeViewingScreen extends Screen { currentCategoryIndex--; if (currentCategoryIndex < 0) currentCategoryIndex = categories.size() - 1; - selectedCategory = categories.get(currentCategoryIndex); + selectedCategory = (RecipeCategory) categories.get(currentCategoryIndex); categoryPages = MathHelper.floor(currentCategoryIndex / (double) TABS_PER_PAGE); page = 0; RecipeViewingScreen.this.init(); @@ -186,7 +186,7 @@ public class RecipeViewingScreen extends Screen { currentCategoryIndex++; if (currentCategoryIndex >= categories.size()) currentCategoryIndex = 0; - selectedCategory = categories.get(currentCategoryIndex); + selectedCategory = (RecipeCategory) categories.get(currentCategoryIndex); categoryPages = MathHelper.floor(currentCategoryIndex / (double) TABS_PER_PAGE); page = 0; RecipeViewingScreen.this.init(); @@ -259,7 +259,7 @@ public class RecipeViewingScreen extends Screen { MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F)); if (getId() + categoryPages * TABS_PER_PAGE == categories.indexOf(selectedCategory)) return false; - selectedCategory = categories.get(getId() + categoryPages * TABS_PER_PAGE); + selectedCategory = (RecipeCategory) categories.get(getId() + categoryPages * TABS_PER_PAGE); page = 0; RecipeViewingScreen.this.init(); return true; @@ -334,7 +334,7 @@ public class RecipeViewingScreen extends Screen { return list; } - public RecipeCategory getSelectedCategory() { + public RecipeCategory getSelectedCategory() { return selectedCategory; } -- cgit