diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MinecraftGLView.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MinecraftGLView.java index 7e4186137..515e3c920 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MinecraftGLView.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/MinecraftGLView.java @@ -577,7 +577,7 @@ public class MinecraftGLView extends TextureView { int barX = (CallbackBridge.physicalWidth / 2) - (barWidth / 2); if(x < barX || x >= barX + barWidth) return -1; - return hotbarKeys[((x - barX) / barWidth / 9) % 9]; + return hotbarKeys[(int) net.kdt.pojavlaunch.utils.MathUtils.map(x, barX, barX + barWidth, 0, 9)]; } /** Return the size, given the UI scale size */ diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/MCOptionUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/MCOptionUtils.java index f149767e0..579cbbf43 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/MCOptionUtils.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/MCOptionUtils.java @@ -2,17 +2,21 @@ package net.kdt.pojavlaunch.utils; import static org.lwjgl.glfw.CallbackBridge.windowHeight; import static org.lwjgl.glfw.CallbackBridge.windowWidth; -import java.io.*; -import java.lang.ref.WeakReference; -import java.util.*; - import android.os.Build; import android.os.FileObserver; -import android.util.*; +import android.util.Log; import androidx.annotation.Nullable; -import net.kdt.pojavlaunch.*; +import net.kdt.pojavlaunch.Tools; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; public class MCOptionUtils { @@ -103,6 +107,8 @@ public class MCOptionUtils } }; } + + fileObserver.startWatching(); } public static void notifyListeners(){