diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-08 13:06:22 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-08 13:06:22 +0200 |
commit | 33cf31553ba9ea38510283443487dcdfaf88ff62 (patch) | |
tree | 1bff6160fdcc1fbe27d2d80167a38bbd011b2748 | |
parent | b2dd5b1dd7f669a4d40a82d19c71f8eb4bdb339a (diff) | |
download | OneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.tar.gz OneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.tar.bz2 OneConfig-33cf31553ba9ea38510283443487dcdfaf88ff62.zip |
nasty nullpointers
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java | 2 |
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()); } } |