Skip to content

Commit e3c212a

Browse files
committed
fix some shitcode
1 parent 1ddb8ca commit e3c212a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main/java/com/falsepattern/lib/dependencies/DependencyLoader.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import java.util.HashSet;
1414
import java.util.Map;
1515
import java.util.Set;
16+
import java.util.concurrent.atomic.AtomicBoolean;
1617

1718
import com.falsepattern.lib.util.FileUtil;
1819
import lombok.*;
@@ -133,6 +134,7 @@ public static void loadLibrary(@NonNull String loadingModId,
133134
preferredVersion,
134135
mavenJarName));
135136
String finalRepo = repo;
137+
val success = new AtomicBoolean(false);
136138
Internet.connect(url, (ex) -> {
137139
FalsePatternLib.getLog()
138140
.info("Artifact {} could not be downloaded from repo {}: {}",
@@ -149,8 +151,11 @@ public static void loadLibrary(@NonNull String loadingModId,
149151
loadedLibraries.put(artifact, preferredVersion);
150152
loadedLibraryMods.put(artifact, loadingModId);
151153
addToClasspath(file);
154+
success.set(true);
152155
});
153-
return;
156+
if (success.get()) {
157+
return;
158+
}
154159
} catch (IOException ignored) {
155160
}
156161
}

0 commit comments

Comments
 (0)