Skip to content

Commit

Permalink
Remove the Architectury workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
YaLTeR committed Jun 12, 2022
1 parent 5e3a004 commit c0e4edb
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/main/java/yalter/mousetweaks/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,6 @@ public static void initialize() {
}

private static void updateScreen(Screen newScreen) {
// Workaround for Architectury wrapping the screen for the mouse drag handler.
// https://github.com/architectury/architectury-api/issues/152
if (newScreen.getClass().getName().equals("dev.architectury.impl.fabric.ScreenInputDelegate$DelegateScreen")) {
try {
Field field = newScreen.getClass().getDeclaredField("parent");
field.setAccessible(true);
newScreen = (Screen) field.get(newScreen);
} catch (Exception e) {
if (Config.debug) {
Logger.Log("Error unwrapping Architectury's DelegateScreen.");
e.printStackTrace();
}
}
}

if (newScreen == openScreen)
return;

Expand Down

0 comments on commit c0e4edb

Please sign in to comment.