Skip to content

Commit

Permalink
Fix use of some library functions not present in a lwjgl3ify-less ins…
Browse files Browse the repository at this point in the history
…tance
  • Loading branch information
eigenraven committed Feb 12, 2024
1 parent 6862c98 commit 19c857a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.13'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
}


Expand Down
15 changes: 9 additions & 6 deletions src/main/java/me/eigenraven/lwjgl3ify/relauncher/Relauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.SystemUtils;
Expand Down Expand Up @@ -209,11 +208,15 @@ public void run() throws IOException {
StandardCharsets.UTF_8);

final List<String> bootstrapCmd = new ArrayList<>();
bootstrapCmd.add(
ArrayUtils.get(
RelauncherConfig.config.javaInstallationsCache,
RelauncherConfig.config.javaInstallation,
SystemUtils.IS_OS_WINDOWS ? "javaw" : "java"));
final String[] javas = RelauncherConfig.config.javaInstallationsCache;
final int javaIdx = RelauncherConfig.config.javaInstallation;
final String javaPath;
if (javaIdx < 0 || javaIdx >= javas.length) {
javaPath = SystemUtils.IS_OS_WINDOWS ? "javaw" : "java";
} else {
javaPath = javas[javaIdx];
}
bootstrapCmd.add(javaPath);
bootstrapCmd.add("@" + argFile);

final ProcessBuilder pb = new ProcessBuilder(bootstrapCmd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public List<String> toJvmArgs() {

public static ConfigObject config = new ConfigObject();
private static final Gson gson = new GsonBuilder().setPrettyPrinting()
.setLenient()
.create();

public static void load() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void startSettingsIfNeeded() {
contents.optGC.setSelectedItem(initCfg.garbageCollector);
contents.optCustom.getDocument()
.putProperty(DefaultEditorKit.EndOfLineStringProperty, "\n");
contents.optCustom.setText(StringUtils.joinWith("\n", (Object[]) initCfg.customOptions));
contents.optCustom.setText(String.join("\n", initCfg.customOptions));
contents.optForwardLogs.setSelected(initCfg.forwardLogs);
contents.optDebugAgent.setSelected(initCfg.allowDebugger);
contents.optDebugSuspend.setSelected(initCfg.waitForDebugger);
Expand Down

0 comments on commit 19c857a

Please sign in to comment.