From 5357ec90f80768b69b197161e877e3ef884650a4 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 May 2019 18:30:54 +0800 Subject: 2.8.2 Build 104 Fixed #81 Close #82 Close #83 --- .../java/me/shedaniel/rei/gui/RecipeViewingScreen.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 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 0f467f723..16af460f4 100644 --- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java +++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java @@ -5,7 +5,6 @@ import com.mojang.blaze3d.platform.GlStateManager; import me.shedaniel.cloth.api.ClientUtils; import me.shedaniel.rei.RoughlyEnoughItemsCore; import me.shedaniel.rei.api.*; -import me.shedaniel.rei.client.ClientHelper; import me.shedaniel.rei.client.ScreenHelper; import me.shedaniel.rei.gui.widget.*; import net.minecraft.client.MinecraftClient; @@ -31,9 +30,9 @@ import java.util.function.Supplier; public class RecipeViewingScreen extends Screen { - public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui/recipecontainer.png"); + public static final Identifier CHEST_GUI_TEXTURE = new Identifier("roughlyenoughitems", "textures/gui" + "/recipecontainer.png"); public static final Color SUB_COLOR = new Color(159, 159, 159); - private static final Identifier CREATIVE_INVENTORY_TABS = new Identifier("textures/gui/container/creative_inventory/tabs.png"); + private static final Identifier CREATIVE_INVENTORY_TABS = new Identifier("textures/gui/container" + "/creative_inventory/tabs.png"); private final List widgets; private final List tabs; private final Map> categoriesMap; @@ -94,6 +93,15 @@ public class RecipeViewingScreen extends Screen { } if (choosePageActivated) return recipeChoosePageWidget.keyPressed(int_1, int_2, int_3); + else if (ClientHelper.getInstance().getNextPageKeyBinding().matchesKey(int_1, int_2)) { + if (recipeNext.enabled) + recipeNext.onPressed(); + return recipeNext.enabled; + } else if (ClientHelper.getInstance().getPreviousPageKeyBinding().matchesKey(int_1, int_2)) { + if (recipeBack.enabled) + recipeBack.onPressed(); + return recipeBack.enabled; + } for(Element element : children()) if (element.keyPressed(int_1, int_2, int_3)) return true; @@ -151,7 +159,7 @@ public class RecipeViewingScreen extends Screen { @Override public void onLabelClicked() { MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F)); - ClientHelper.executeViewAllRecipesKeyBind(); + ClientHelper.getInstance().executeViewAllRecipesKeyBind(); } }); widgets.add(categoryNext = new ButtonWidget((int) bounds.getMaxX() - 17, (int) bounds.getY() + 5, 12, 12, new TranslatableTextComponent("text.rei.right_arrow")) { -- cgit