1919import dev .terminalmc .modlistmemory .config .Config ;
2020import dev .terminalmc .modlistmemory .util .ModLogger ;
2121import net .minecraft .client .Minecraft ;
22- import net .minecraft .client .gui . screens . Screen ;
22+ import net .minecraft .client .input . MouseButtonEvent ;
2323import net .minecraft .network .chat .Component ;
2424import net .minecraft .util .FormattedCharSequence ;
2525
@@ -71,8 +71,8 @@ public static void onModOpened(String modId) {
7171 }
7272 }
7373
74- public static boolean onModClicked (String modId ) {
75- if (ModListMemory .hasKeyDown (options ().pinKey )) {
74+ public static boolean onModClicked (MouseButtonEvent click , String modId ) {
75+ if (ModListMemory .hasKeyDown (click , options ().pinKey )) {
7676 // Pin, or move to the top of the pin list
7777 options ().recentMods .remove (modId );
7878 options ().pinnedMods .remove (modId );
@@ -85,7 +85,7 @@ public static boolean onModClicked(String modId) {
8585 }
8686 return true ;
8787 }
88- else if (ModListMemory .hasKeyDown (options ().unpinKey )
88+ else if (ModListMemory .hasKeyDown (click , options ().unpinKey )
8989 && options ().pinnedMods .contains (modId )) {
9090 // Unpin
9191 options ().pinnedMods .remove (modId );
@@ -97,11 +97,11 @@ && options().pinnedMods.contains(modId)) {
9797 return false ;
9898 }
9999
100- public static boolean hasKeyDown (Config .Key key ) {
100+ public static boolean hasKeyDown (MouseButtonEvent click , Config .Key key ) {
101101 return switch (key ) {
102- case CONTROL -> Screen .hasControlDown ();
103- case ALT -> Screen .hasAltDown ();
104- case SHIFT -> Screen .hasShiftDown ();
102+ case CONTROL -> click .hasControlDown ();
103+ case ALT -> click .hasAltDown ();
104+ case SHIFT -> click .hasShiftDown ();
105105 case NONE -> false ;
106106 };
107107 }
0 commit comments