aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/gui/REIRenderHelper.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-04 21:47:38 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-04 21:47:38 +0800
commite64108cf1b6cd147bece207453ad0ede8c4b5bd7 (patch)
tree347a279b7a214c37adc1e0f12e139fab03ac61d4 /src/main/java/me/shedaniel/gui/REIRenderHelper.java
parentc45432d9460c1f0b1caad955e57282b69754d7e6 (diff)
downloadRoughlyEnoughItems-e64108cf1b6cd147bece207453ad0ede8c4b5bd7.tar.gz
RoughlyEnoughItems-e64108cf1b6cd147bece207453ad0ede8c4b5bd7.tar.bz2
RoughlyEnoughItems-e64108cf1b6cd147bece207453ad0ede8c4b5bd7.zip
fixes esc and crashes
Diffstat (limited to 'src/main/java/me/shedaniel/gui/REIRenderHelper.java')
-rwxr-xr-xsrc/main/java/me/shedaniel/gui/REIRenderHelper.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/main/java/me/shedaniel/gui/REIRenderHelper.java b/src/main/java/me/shedaniel/gui/REIRenderHelper.java
index cd68534f3..985eb721f 100755
--- a/src/main/java/me/shedaniel/gui/REIRenderHelper.java
+++ b/src/main/java/me/shedaniel/gui/REIRenderHelper.java
@@ -238,41 +238,45 @@ public class REIRenderHelper {
reiGui.tick();
}
- public static void recipeKeybind() {
+ public static boolean recipeKeyBind() {
if (!(MinecraftClient.getInstance().currentGui instanceof ContainerGui))
- return;
+ return false;
Control control = reiGui.getLastHovered();
if (control != null && control.isHighlighted() && control instanceof REISlot) {
REISlot slot = (REISlot) control;
REIRecipeManager.instance().displayRecipesFor(slot.getStack());
- return;
+ return true;
}
if (((IMixinContainerGui) overlayedGui).getHoveredSlot() != null) {
ItemStack stack = ((IMixinContainerGui) overlayedGui).getHoveredSlot().getStack();
REIRecipeManager.instance().displayRecipesFor(stack);
+ return true;
}
-
+ return false;
}
- public static void useKeybind() {
+ public static boolean useKeyBind() {
if (!(MinecraftClient.getInstance().currentGui instanceof ContainerGui))
- return;
+ return false;
Control control = reiGui.getLastHovered();
if (control != null && control.isHighlighted() && control instanceof REISlot) {
REISlot slot = (REISlot) control;
REIRecipeManager.instance().displayUsesFor(slot.getStack());
- return;
+ return true;
}
if (((IMixinContainerGui) overlayedGui).getHoveredSlot() != null) {
ItemStack stack = ((IMixinContainerGui) overlayedGui).getHoveredSlot().getStack();
REIRecipeManager.instance().displayUsesFor(stack);
+ return true;
}
-
+ return false;
}
- public static void hideKeybind() {
+ public static boolean hideKeyBind() {
if (MinecraftClient.getInstance().currentGui == overlayedGui && reiGui != null) {
reiGui.visible = !reiGui.visible;
+ return true;
}
+ return false;
}
}