aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
diff options
context:
space:
mode:
authorRoman / Linnea Gräf <roman.graef@gmail.com>2022-12-09 13:19:54 +0100
committerGitHub <noreply@github.com>2022-12-09 23:19:54 +1100
commit337b77aa50db6b4a159795827623d36acccbdcc4 (patch)
tree07b107d9925de565e78bf02a1526881bd05b1519 /src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
parentac74ab8c13cf486cf36cb911f0a723908b0c5072 (diff)
downloadnotenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.tar.gz
notenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.tar.bz2
notenoughupdates-337b77aa50db6b4a159795827623d36acccbdcc4.zip
Katting (#447)
Co-authored-by: nea <romangraef@gmail.com> Co-authored-by: nea <roman.graef@gmail.com> Co-authored-by: nea <nea@nea.moe> Co-authored-by: nea <romangraef@loves.dicksinhisan.us> Co-authored-by: nea <roman.graef@grb-online.net> Co-authored-by: nea <hello@nea89.moe> Co-authored-by: nea <roman.graef@stud.tu-darmstadt.de>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
index cc9f36fa..e4b4269d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java
@@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.recipes.RecipeHistory;
import io.github.moulberry.notenoughupdates.recipes.RecipeSlot;
import io.github.moulberry.notenoughupdates.recipes.RecipeType;
import io.github.moulberry.notenoughupdates.util.Utils;
+import lombok.var;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
@@ -314,7 +315,7 @@ public class GuiItemRecipe extends GuiScreen {
TAB_SIZE_X,
TAB_SIZE_Y
)) {
- changeRecipe(i, currentIndex);
+ changeRecipe(i, 0);
Utils.playPressSound();
return;
}
@@ -336,6 +337,16 @@ public class GuiItemRecipe extends GuiScreen {
currentRecipe.mouseClicked(this, mouseX, mouseY, mouseButton);
}
+ @Override
+ public void handleMouseInput() throws IOException {
+ super.handleMouseInput();
+ ScaledResolution scaledResolution = Utils.peekGuiScale();
+ int mouseX = Mouse.getX() * scaledResolution.getScaledWidth() / Minecraft.getMinecraft().displayWidth;
+ int mouseY = scaledResolution.getScaledHeight() -
+ Mouse.getY() * scaledResolution.getScaledHeight() / Minecraft.getMinecraft().displayHeight - 1;
+ getCurrentRecipe().genericMouseInput(mouseX, mouseY);
+ }
+
public void arrowKeyboardInput() {
ArrowPagesUtils.onPageSwitchKey(currentIndex, getCurrentRecipeList().size(), pageChange ->
changeRecipe(currentTab, pageChange));