Skip to content

Commit 58493e5

Browse files
committed
Update 1.2.10
1 parent 6cbeb97 commit 58493e5

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

common/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88
api 'org.ow2.asm:asm-commons:9.5'
99
api 'org.semver4j:semver4j:4.3.0'
1010
api 'org.spongepowered:mixin:0.8.5'
11-
api 'com.github.LlamaLad7.MixinExtras:mixinextras-common:0.2.0-beta.8'
11+
api 'com.github.LlamaLad7.MixinExtras:mixinextras-common:0.2.0-beta.9'
1212
api 'org.luaj:luaj-jse:3.0.1'
1313

1414
// Mixin dependencies

common/src/main/java/com/fox2code/foxloader/launcher/DependencyHelper.java

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ GSON_DEPENDENCY, new Dependency("com.google.guava:guava:21.0", MAVEN_CENTRAL, "c
3131
new Dependency("org.apache.commons:commons-lang3:3.3.2", MAVEN_CENTRAL, "org.apache.commons.lang3.tuple.Pair"),
3232
new Dependency("org.luaj:luaj-jse:3.0.1", MAVEN_CENTRAL, "org.luaj.vm2.Globals"),
3333
new Dependency("org.spongepowered:mixin:0.8.5", SPONGE_POWERED, "org.spongepowered.asm.mixin.Mixins"),
34-
new Dependency("com.github.LlamaLad7.MixinExtras:mixinextras-common:0.2.0-beta.8",
35-
JITPACK, "com.llamalad7.mixinextras.MixinExtrasBootstrap"),
34+
new Dependency("com.github.LlamaLad7.MixinExtras:mixinextras-common:0.2.0-beta.9",
35+
JITPACK, "com.llamalad7.mixinextras.MixinExtrasBootstrap",
36+
// Need fallback URL cause JitPack links can ded at any time
37+
"https://github.com/LlamaLad7/MixinExtras/releases/download/0.2.0-beta.9/mixinextras-common-0.2.0-beta.9.jar"),
3638
};
3739

3840
public static final Dependency sparkDependency =
@@ -142,13 +144,27 @@ private static File loadDependencyImpl(Dependency dependency, boolean minecraft,
142144
if (!parentFile.isDirectory() && !parentFile.mkdirs()) {
143145
throw new RuntimeException("Cannot create dependency directory for " + dependency.name);
144146
}
147+
IOException fallBackIoe = null;
145148
try (OutputStream os = Files.newOutputStream(file.toPath())) {
146149
justDownloaded = true;
147150
NetUtils.downloadTo(new URL(dependency.repository.endsWith(".jar") ?
148151
dependency.repository : dependency.repository + "/" + postURL), os);
149152
} catch (IOException ioe) {
150-
if (file.exists() && !file.delete()) file.deleteOnExit();
151-
throw new RuntimeException("Cannot download " + dependency.name, ioe);
153+
if (dependency.fallbackUrl != null) {
154+
fallBackIoe = ioe;
155+
} else {
156+
if (file.exists() && !file.delete()) file.deleteOnExit();
157+
throw new RuntimeException("Cannot download " + dependency.name, ioe);
158+
}
159+
}
160+
if (fallBackIoe != null) {
161+
try (OutputStream os = Files.newOutputStream(file.toPath())) {
162+
justDownloaded = true;
163+
NetUtils.downloadTo(new URL(dependency.fallbackUrl), os);
164+
} catch (IOException ioe) {
165+
if (file.exists() && !file.delete()) file.deleteOnExit();
166+
throw new RuntimeException("Cannot download " + dependency.name, fallBackIoe);
167+
}
152168
}
153169
}
154170
if (dev) return file; // We don't have a FoxClass loader in dev environment.
@@ -286,12 +302,17 @@ private static String resolvePostURL(String string) {
286302
}
287303

288304
public static class Dependency {
289-
public final String name, repository, classCheck;
305+
public final String name, repository, classCheck, fallbackUrl;
290306

291307
public Dependency(String name, String repository, String classCheck) {
308+
this(name, repository, classCheck, null);
309+
}
310+
311+
public Dependency(String name, String repository, String classCheck, String fallbackUrl) {
292312
this.name = name;
293313
this.repository = repository;
294314
this.classCheck = classCheck;
315+
this.fallbackUrl = fallbackUrl;
295316
}
296317
}
297318
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.parallel=true
33
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8
44

55
# FoxLoader properties
6-
foxloader.version=1.2.9
6+
foxloader.version=1.2.10
77
foxloader.lastReIndevTransformerChanges=1.2.4
88

99
# ReIndev properties

0 commit comments

Comments
 (0)