aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-07-05 15:31:12 +0800
committershedaniel <daniel@shedaniel.me>2020-07-05 15:31:12 +0800
commit17150bedcdf80944a64e165976cf2491d409b1c0 (patch)
treef71725bf6c37fd2bc82fbf8bf07a4b98ba2d1584 /src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
parentaf1b3f780d8edb361c00421cdd991f3f2b86849c (diff)
downloadRoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.gz
RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.tar.bz2
RoughlyEnoughItems-17150bedcdf80944a64e165976cf2491d409b1c0.zip
Fix #370 and changes to how screens are handled
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
index 52efc96c3..12464c636 100644
--- a/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
+++ b/src/main/java/me/shedaniel/rei/gui/RecipeViewingScreen.java
@@ -57,14 +57,16 @@ import net.minecraft.sound.SoundEvents;
import net.minecraft.text.LiteralText;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
-import net.minecraft.util.Formatting;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Matrix4f;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
-import java.util.*;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
import java.util.function.Supplier;
@ApiStatus.Internal
@@ -497,6 +499,9 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen {
if (choosePageActivated) {
return recipeChoosePageWidget.mouseDragged(double_1, double_2, int_1, double_3, double_4);
}
+ for (Element entry : children())
+ if (entry.mouseDragged(double_1, double_2, int_1, double_3, double_4))
+ return true;
return super.mouseDragged(double_1, double_2, int_1, double_3, double_4);
}
@@ -505,6 +510,9 @@ public class RecipeViewingScreen extends Screen implements RecipeScreen {
if (choosePageActivated) {
return recipeChoosePageWidget.mouseReleased(double_1, double_2, int_1);
}
+ for (Element entry : children())
+ if (entry.mouseReleased(double_1, double_2, int_1))
+ return true;
return super.mouseReleased(double_1, double_2, int_1);
}