From 33cf31553ba9ea38510283443487dcdfaf88ff62 Mon Sep 17 00:00:00 2001 From: DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> Date: Sun, 8 May 2022 13:06:22 +0200 Subject: nasty nullpointers --- src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/main/java/cc/polyfrost/oneconfig/utils/InputUtils.java') 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()); } } -- cgit