Skip to content

Commit e99aac9

Browse files
committed
just use tabs everywhere
1 parent 9c4b18c commit e99aac9

7 files changed

Lines changed: 109 additions & 109 deletions

File tree

src/main/java/org/quiltmc/installer/Connections.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@
2121
import java.net.URLConnection;
2222

2323
public class Connections {
24-
public static final String INSTALLER_VERSION = getInstallerVersion();
24+
public static final String INSTALLER_VERSION = getInstallerVersion();
2525

26-
private static String getInstallerVersion() {
27-
String version = OrnitheMeta.class.getPackage().getImplementationVersion();
28-
if (version != null) {
29-
return version;
30-
}
26+
private static String getInstallerVersion() {
27+
String version = OrnitheMeta.class.getPackage().getImplementationVersion();
28+
if (version != null) {
29+
return version;
30+
}
3131

32-
return "dev";
33-
}
32+
return "dev";
33+
}
3434

35-
public static URLConnection openConnection(URL url) throws IOException {
36-
URLConnection connection = url.openConnection();
37-
connection.setRequestProperty("User-Agent", "Ornithe-Installer/"+INSTALLER_VERSION);
35+
public static URLConnection openConnection(URL url) throws IOException {
36+
URLConnection connection = url.openConnection();
37+
connection.setRequestProperty("User-Agent", "Ornithe-Installer/"+INSTALLER_VERSION);
3838

39-
return connection;
40-
}
39+
return connection;
40+
}
4141
}

src/main/java/org/quiltmc/installer/LaunchJson.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ private static Map<String, Object> buildPackJsonMap(
137137
moddedJsonMap.put("name", "Minecraft");
138138
moddedJsonMap.put("releaseTime", vanilaMap.get("releaseTime"));
139139
moddedJsonMap.put("requires", Lists.of(
140-
Maps.of(
141-
"suggests", "${lwjgl_version}",
140+
Maps.of(
141+
"suggests", "${lwjgl_version}",
142142
"uid", "${lwjgl_uid}"
143143
)
144-
));
144+
));
145145
moddedJsonMap.put("type", vanilaMap.get("type"));
146146
moddedJsonMap.put("uid", "net.minecraft");
147147
moddedJsonMap.put("version", gameVersion);
@@ -160,8 +160,8 @@ public static CompletableFuture<String> get(VersionManifest.Version gameVersion)
160160
Map<String, Object> map;
161161

162162
try (InputStreamReader input = new InputStreamReader(connection.getInputStream())) {
163-
//noinspection unchecked
164-
map = (Map<String, Object>) Gsons.read(JsonReader.json(input));
163+
//noinspection unchecked
164+
map = (Map<String, Object>) Gsons.read(JsonReader.json(input));
165165
}
166166

167167
// add the -vanilla suffix to the vanilla json 'cause
@@ -229,9 +229,9 @@ public static CompletableFuture<String> get(GameSide side, VersionManifest.Versi
229229
// Prevents a log warning about being unable to reach the active user beacon on stable versions.
230230
switch (loaderVersion) {
231231
case "0.19.2":
232-
case "0.19.4":
233-
case "0.19.3":
234-
disableBeacon(map);
232+
case "0.19.4":
233+
case "0.19.3":
234+
disableBeacon(map);
235235
}
236236
}
237237

src/main/java/org/quiltmc/installer/Main.java

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -24,73 +24,73 @@
2424

2525
// We enter in java 8 so we can display a nice error message if things don't work
2626
public class Main {
27-
public static void main(String[] args) {
28-
try {
29-
// Only use CLI mode if there are any arguments or we have a headless JVM
30-
if (GraphicsEnvironment.isHeadless() || args.length != 0) {
31-
MethodHandles.lookup()
32-
.findStatic(Class.forName("org.quiltmc.installer.CliInstaller"), "run", MethodType.methodType(void.class, String[].class))
33-
.invokeExact(args);
34-
} else {
35-
MethodHandles.lookup()
36-
.findStatic(Class.forName("org.quiltmc.installer.gui.swing.SwingInstaller"), "run", MethodType.methodType(void.class))
37-
.invokeExact();
38-
}
39-
} catch (UnsupportedClassVersionError error) {
40-
if (GraphicsEnvironment.isHeadless() || args.length != 0) {
41-
System.out.println("Quilt Installer requires Java 17 to run.");
42-
System.exit(1);
43-
} else {
44-
try {
45-
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
46-
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException |
47-
InstantiationException e) {
48-
// oh well
49-
e.printStackTrace();
50-
}
27+
public static void main(String[] args) {
28+
try {
29+
// Only use CLI mode if there are any arguments or we have a headless JVM
30+
if (GraphicsEnvironment.isHeadless() || args.length != 0) {
31+
MethodHandles.lookup()
32+
.findStatic(Class.forName("org.quiltmc.installer.CliInstaller"), "run", MethodType.methodType(void.class, String[].class))
33+
.invokeExact(args);
34+
} else {
35+
MethodHandles.lookup()
36+
.findStatic(Class.forName("org.quiltmc.installer.gui.swing.SwingInstaller"), "run", MethodType.methodType(void.class))
37+
.invokeExact();
38+
}
39+
} catch (UnsupportedClassVersionError error) {
40+
if (GraphicsEnvironment.isHeadless() || args.length != 0) {
41+
System.out.println("Quilt Installer requires Java 17 to run.");
42+
System.exit(1);
43+
} else {
44+
try {
45+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
46+
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException |
47+
InstantiationException e) {
48+
// oh well
49+
e.printStackTrace();
50+
}
5151

5252

53-
showPopup("Ornithe Installer crashed!", "<html>Ornithe Installer needs Java 17 to run.<br><br>" +
54-
"Install the latest LTS release of Java from <a href=\"https://adoptium.net/\">Eclipse Adoptium</a> and try again." +
55-
"<br><br>If you need help, ask" +
56-
" in the <a href=\"https://discord.gg/JbRbRf62pn\">Ornithe Discord server</a>.</html>", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
57-
System.exit(1);
58-
}
59-
} catch (Throwable t) {
60-
throw new RuntimeException(t);
61-
}
62-
}
53+
showPopup("Ornithe Installer crashed!", "<html>Ornithe Installer needs Java 17 to run.<br><br>" +
54+
"Install the latest LTS release of Java from <a href=\"https://adoptium.net/\">Eclipse Adoptium</a> and try again." +
55+
"<br><br>If you need help, ask" +
56+
" in the <a href=\"https://discord.gg/JbRbRf62pn\">Ornithe Discord server</a>.</html>", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
57+
System.exit(1);
58+
}
59+
} catch (Throwable t) {
60+
throw new RuntimeException(t);
61+
}
62+
}
6363

64-
// Copied from AbstractPanel
65-
protected static boolean showPopup(String title, String description, int optionType, int messageType) {
66-
JEditorPane pane = new JEditorPane("text/html",
67-
"<html><body style=\"" + buildEditorPaneStyle() + "\">" + description + "</body></html>");
68-
pane.setEditable(false);
69-
pane.addHyperlinkListener(e -> {
70-
try {
71-
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
72-
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
73-
Desktop.getDesktop().browse(e.getURL().toURI());
74-
} else {
75-
throw new UnsupportedOperationException("Failed to open " + e.getURL().toString());
76-
}
77-
}
78-
} catch (Throwable throwable) {
79-
// Oh well
80-
throwable.printStackTrace();
81-
}
82-
});
83-
return JOptionPane.showOptionDialog(null, pane, title, optionType, messageType, null, null, null) == 0;
84-
}
64+
// Copied from AbstractPanel
65+
protected static boolean showPopup(String title, String description, int optionType, int messageType) {
66+
JEditorPane pane = new JEditorPane("text/html",
67+
"<html><body style=\"" + buildEditorPaneStyle() + "\">" + description + "</body></html>");
68+
pane.setEditable(false);
69+
pane.addHyperlinkListener(e -> {
70+
try {
71+
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
72+
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
73+
Desktop.getDesktop().browse(e.getURL().toURI());
74+
} else {
75+
throw new UnsupportedOperationException("Failed to open " + e.getURL().toString());
76+
}
77+
}
78+
} catch (Throwable throwable) {
79+
// Oh well
80+
throwable.printStackTrace();
81+
}
82+
});
83+
return JOptionPane.showOptionDialog(null, pane, title, optionType, messageType, null, null, null) == 0;
84+
}
8585

86-
private static String buildEditorPaneStyle() {
87-
JLabel label = new JLabel();
88-
Font font = label.getFont();
89-
Color color = label.getBackground();
86+
private static String buildEditorPaneStyle() {
87+
JLabel label = new JLabel();
88+
Font font = label.getFont();
89+
Color color = label.getBackground();
9090

91-
return String.format(
92-
"font-family:%s;font-weight:%s;font-size:%dpt;background-color: rgb(%d,%d,%d);",
93-
font.getFamily(), (font.isBold() ? "bold" : "normal"), font.getSize(), color.getRed(), color.getGreen(), color.getBlue()
94-
);
95-
}
91+
return String.format(
92+
"font-family:%s;font-weight:%s;font-size:%dpt;background-color: rgb(%d,%d,%d);",
93+
font.getFamily(), (font.isBold() ? "bold" : "normal"), font.getSize(), color.getRed(), color.getGreen(), color.getBlue()
94+
);
95+
}
9696
}

src/main/java/org/quiltmc/installer/OrnitheMeta.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,22 @@ public static Endpoint<int[]> intermediaryGenerationsEndpoint() {
5252
reader.skipValue();
5353
continue;
5454
}
55-
switch (reader.nextName()) {
55+
switch (reader.nextName()) {
5656
case "latestIntermediaryGeneration":
57-
if (reader.peek() != JsonToken.NUMBER) {
58-
throw new ParseException("Version must be a number", reader);
59-
}
60-
gens[0] = reader.nextInt();
57+
if (reader.peek() != JsonToken.NUMBER) {
58+
throw new ParseException("Version must be a number", reader);
59+
}
60+
gens[0] = reader.nextInt();
6161
break;
6262
case "stableIntermediaryGeneration":
63-
if (reader.peek() != JsonToken.NUMBER) {
64-
throw new ParseException("maven must be a number", reader);
65-
}
66-
gens[1] = reader.nextInt();
63+
if (reader.peek() != JsonToken.NUMBER) {
64+
throw new ParseException("maven must be a number", reader);
65+
}
66+
gens[1] = reader.nextInt();
6767
break;
6868
default:
6969
reader.skipValue();
70-
}
70+
}
7171
}
7272

7373
if (gens[0] == 0) {
@@ -125,22 +125,22 @@ public static final Endpoint<List<Intermediary>> intermediaryVersionsEndpoint(Op
125125
reader.skipValue();
126126
continue;
127127
}
128-
switch (reader.nextName()) {
128+
switch (reader.nextName()) {
129129
case "version":
130-
if (reader.peek() != JsonToken.STRING) {
131-
throw new ParseException("Version must be a string", reader);
132-
}
133-
version = reader.nextString();
130+
if (reader.peek() != JsonToken.STRING) {
131+
throw new ParseException("Version must be a string", reader);
132+
}
133+
version = reader.nextString();
134134
break;
135135
case "maven":
136-
if (reader.peek() != JsonToken.STRING) {
137-
throw new ParseException("maven must be a string", reader);
138-
}
139-
maven = reader.nextString();
136+
if (reader.peek() != JsonToken.STRING) {
137+
throw new ParseException("maven must be a string", reader);
138+
}
139+
maven = reader.nextString();
140140
break;
141141
case "stable":
142142
reader.nextBoolean(); // TODO
143-
}
143+
}
144144
}
145145

146146
if (version == null) {

src/main/java/org/quiltmc/installer/action/InstallMessageType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
package org.quiltmc.installer.action;
1818

1919
public enum InstallMessageType {
20-
SUCCEED,
21-
FAIL
20+
SUCCEED,
21+
FAIL
2222
}

src/main/java/org/quiltmc/installer/action/InstallServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public void run(Consumer<InstallMessageType> statusTracker) {
225225
} catch (InterruptedException | ExecutionException e) {
226226
throw new RuntimeException(e);
227227
}
228-
}).exceptionally(e -> {
228+
}).exceptionally(e -> {
229229
e.printStackTrace();
230230
statusTracker.accept(InstallMessageType.FAIL);
231231
return null;

src/main/java/org/quiltmc/installer/gui/swing/SwingInstaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static void run() {
3939
try {
4040
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
4141
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException |
42-
InstantiationException e) {
42+
InstantiationException e) {
4343
e.printStackTrace();
4444
}
4545

0 commit comments

Comments
 (0)