Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Comments

Fixes IOFleException by correcting the file path#20

Open
Shotsphere wants to merge 2 commits intoTEALSK12:masterfrom
Shotsphere:File-Exception-Fix
Open

Fixes IOFleException by correcting the file path#20
Shotsphere wants to merge 2 commits intoTEALSK12:masterfrom
Shotsphere:File-Exception-Fix

Conversation

@Shotsphere
Copy link

No description provided.

@Shotsphere Shotsphere requested a review from hollasch December 18, 2024 00:26
@Shotsphere Shotsphere marked this pull request as draft December 18, 2024 00:26
@Shotsphere Shotsphere marked this pull request as ready for review December 18, 2024 00:37
@hollasch
Copy link
Member

Thanks for coming back on this! I'm annoyed by the misspelled FILE_SEPERATOR, and its lack of need (not your fault). Also, the path construction could be simpler. Can you try the following changes to see if this addresses your problem?

diff --git a/src/forge/production/lib/gradle/start/GradleStart.java b/src/forge/production/lib/gradle/start/GradleStart.java
index f6b7679..707b8a9 100644
--- a/src/forge/production/lib/gradle/start/GradleStart.java
+++ b/src/forge/production/lib/gradle/start/GradleStart.java
@@ -34,7 +34,6 @@ import net.minecraftforge.gradle.OldPropertyMapSerializer;
 
 public class GradleStart extends GradleStartCommon {
 
-      private static final String FILE_SEPERATOR = File.separator;
       private static final Gson GSON;
 
       public GradleStart() {
@@ -58,7 +57,8 @@ public class GradleStart extends GradleStartCommon {
       protected void setDefaultArguments(Map<String, String> argumentMap) {
             argumentMap.put("version", "1.7.10");
             argumentMap.put("assetIndex", "1.7.10");
-            argumentMap.put("assetsDir", new File("").getAbsolutePath() + FILE_SEPERATOR + "lib" + FILE_SEPERATOR + "gradle" + FILE_SEPERATOR + "assets");
+            argumentMap.put("assetsDir", String.join(File.separator, new File("").getAbsolutePath(),
+                "Minecraft", "production", "lib", "gradle", "assets");
             argumentMap.put("accessToken", "FML");
             argumentMap.put("userProperties", "{}");
             argumentMap.put("username", null);
@@ -78,7 +78,8 @@ public class GradleStart extends GradleStartCommon {
 
       private static void hackNatives() {
             String libraryPath = System.getProperty("java.library.path");
-            String libraryLocation = new File("").getAbsolutePath() + FILE_SEPERATOR + "lib" + FILE_SEPERATOR + "gradle" + FILE_SEPERATOR + "natives";
+            String libraryLocation = String.join(File.separator, new File("").getAbsolutePath(),
+                "lib", "gradle", "natives");
             if(Strings.isNullOrEmpty(libraryPath)) {
                   libraryPath = libraryLocation;
             } else {

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants