aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-08 13:06:22 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2022-05-08 13:06:22 +0200
commit33cf31553ba9ea38510283443487dcdfaf88ff62 (patch)
tree1bff6160fdcc1fbe27d2d80167a38bbd011b2748
parentb2dd5b1dd7f669a4d40a82d19c71f8eb4bdb339a (diff)
downloadOneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.tar.gz
OneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.tar.bz2
OneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.zip
nasty nullpointers
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java
index 13b34da..7f2e5d2 100644
--- a/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java
+++ b/src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java
@@ -25,10 +25,12 @@ public class InputUtils {
}
public static int mouseX() {
+ if (OneConfigGui.INSTANCE == null) return Mouse.getX();
return (int) (Mouse.getX() / OneConfigGui.INSTANCE.getScaleFactor());
}
public static int mouseY() {
+ if (OneConfigGui.INSTANCE == null) return Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY());
return (int) ((Minecraft.getMinecraft().displayHeight - Math.abs(Mouse.getY())) / OneConfigGui.INSTANCE.getScaleFactor());
}
}