Skip to content

Commit

Permalink
Fix: code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Moresteck committed Oct 11, 2024
1 parent 088537e commit 5edc74f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/main/java/uk/betacraft/legacyfix/patch/impl/DeAwtPatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,21 @@ public void edit(MethodCall mc) throws CannotCompileException {
// Resolution
intCount++;

// @formatter:off
minecraftConstructor.insertBefore(
"Class legacyfix = ClassLoader.getSystemClassLoader().loadClass(\"uk.betacraft.legacyfix.LegacyFixLauncher\");" +
"$" + (i + 1) + " = ((Integer) legacyfix.getMethod(\"getWidth\", null).invoke(null, null)).intValue();" +
"$" + (i + 2) + " = ((Integer) legacyfix.getMethod(\"getHeight\", null).invoke(null, null)).intValue();"
"Class legacyfix = ClassLoader.getSystemClassLoader().loadClass(\"uk.betacraft.legacyfix.LegacyFixLauncher\");" +
"$" + (i + 1) + " = ((Integer) legacyfix.getMethod(\"getWidth\", null).invoke(null, null)).intValue();" +
"$" + (i + 2) + " = ((Integer) legacyfix.getMethod(\"getHeight\", null).invoke(null, null)).intValue();"
);
// @formatter:on
} else if (className.equals("boolean")) {
// Fullscreen
// @formatter:off
minecraftConstructor.insertBefore(
"Class legacyfix = ClassLoader.getSystemClassLoader().loadClass(\"uk.betacraft.legacyfix.LegacyFixLauncher\");" +
"$" + (i + 1) + " = ((Boolean) legacyfix.getMethod(\"getFullscreen\", null).invoke(null, null)).booleanValue();"
"Class legacyfix = ClassLoader.getSystemClassLoader().loadClass(\"uk.betacraft.legacyfix.LegacyFixLauncher\");" +
"$" + (i + 1) + " = ((Boolean) legacyfix.getMethod(\"getFullscreen\", null).invoke(null, null)).booleanValue();"
);
// @formatter:on
} else if (className.equals("java.awt.Canvas") || className.equals(minecraftAppletClass.getName())) {
// Nullify Canvas & MinecraftApplet
minecraftConstructor.insertBefore("$" + (i + 1) + " = null;");
Expand Down

0 comments on commit 5edc74f

Please sign in to comment.