diff --git a/build.gradle b/build.gradle index fe8a2e7b..e2e8960e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1675110695 +//version: 1675173326 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -66,7 +66,7 @@ plugins { id 'com.diffplug.spotless' version '6.7.2' apply false id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.1.2' + id 'com.gtnewhorizons.retrofuturagradle' version '1.1.3' } boolean settingsupdated = verifySettingsGradle() settingsupdated = verifyGitAttributes() || settingsupdated @@ -743,6 +743,7 @@ idea { module { downloadJavadoc = true downloadSources = true + inheritOutputDirs = true } project { settings { diff --git a/src/main/java/invtweaks/InvTweaksHandlerShortcuts.java b/src/main/java/invtweaks/InvTweaksHandlerShortcuts.java index c921748e..5a216e41 100644 --- a/src/main/java/invtweaks/InvTweaksHandlerShortcuts.java +++ b/src/main/java/invtweaks/InvTweaksHandlerShortcuts.java @@ -10,6 +10,7 @@ import net.minecraft.item.ItemStack; import org.apache.logging.log4j.Logger; +import org.lwjgl.Sys; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -50,11 +51,14 @@ private class ShortcutConfig { */ private Map> shortcuts; + private boolean newLwjglDetected; + public InvTweaksHandlerShortcuts(Minecraft mc, InvTweaksConfig config) { super(mc); this.config = config; this.pressedKeys = new HashMap(); this.shortcuts = new HashMap>(); + this.newLwjglDetected = !Sys.getVersion().startsWith("2."); } public void loadShortcuts() { @@ -123,12 +127,14 @@ public void handleShortcut() { // Reset mouse status to prevent default action. // TODO Find a better solution, like 'anticipate' default action? - Mouse.destroy(); - Mouse.create(); + if (!newLwjglDetected) { + Mouse.destroy(); + Mouse.create(); - // Fixes a tiny glitch (Steve looks for a short moment - // at [0, 0] because of the mouse reset). - Mouse.setCursorPosition(ex, ey); + // Fixes a tiny glitch (Steve looks for a short moment + // at [0, 0] because of the mouse reset). + Mouse.setCursorPosition(ex, ey); + } } } catch (Exception e) {