Skip to content

Commit b922df1

Browse files
committed
Update 1.2.11
1 parent 548e2bf commit b922df1

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

betacraft/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ dependencies {
1919
}
2020

2121
tasks.withType(Jar) {
22-
exclude('org/betacraft/*')
22+
exclude('org/*')
2323
}

client/src/main/java/com/fox2code/foxloader/loader/ClientModLoader.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.fox2code.foxloader.launcher.LauncherType;
55
import com.fox2code.foxloader.launcher.utils.NetUtils;
66
import com.fox2code.foxloader.launcher.utils.Platform;
7+
import com.fox2code.foxloader.launcher.utils.SourceUtil;
78
import com.fox2code.foxloader.loader.packet.ClientHello;
89
import com.fox2code.foxloader.loader.packet.ServerHello;
910
import com.fox2code.foxloader.network.NetworkPlayer;
@@ -87,10 +88,20 @@ void loaderHandleDoFoxLoaderUpdate(String version, String url) throws IOExceptio
8788
switch (launcherType) {
8889
default:
8990
return;
91+
case BETA_CRAFT:
92+
File betacraftSource = SourceUtil.getSourceFile(ClientModLoader.class).getParentFile();
93+
String endPath = ".betacraft/versions";
94+
String path = betacraftSource.getPath();
95+
if (!path.replace('\\', '/').endsWith(endPath)) {
96+
this.getLogger().warning("Not BetaCraft?");
97+
return;
98+
}
99+
args = new String[]{null, "-jar", null, "--update", launcherType.name(),
100+
path.substring(0, path.length() - endPath.length())};
101+
break;
90102
case MMC_LIKE:
91103
File libraries = ModLoader.foxLoader.file.getParentFile();
92104
dest = new File(libraries, "foxloader-" + version + ".jar");
93-
case BETA_CRAFT:
94105
case VANILLA_LIKE:
95106
args = new String[]{null, "-jar", null, "--update", launcherType.name()};
96107
}

final/src/main/java/com/fox2code/foxloader/installer/InstallerGUI.java

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,20 @@ public void installMineCraft() {
272272
}
273273

274274
public void installBetaCraft() {
275+
File betacraft = Platform.getAppDir("betacraft");
276+
if (!betacraft.exists()) {
277+
File betacraftPortable = new File(".betacraft").getAbsoluteFile();
278+
if (betacraftPortable.exists()) {
279+
betacraft = betacraftPortable;
280+
}
281+
}
282+
this.installBetaCraftEx(betacraft);
283+
}
284+
285+
public void installBetaCraftEx(File betaCraft) {
275286
if (this.checkInstaller()) {
276287
return;
277288
}
278-
File betaCraft = Platform.getAppDir("betacraft");
279289
File versions = new File(betaCraft, "versions");
280290
File versionsJsons = new File(versions, "jsons");
281291
File launchMethods = new File(betaCraft,
@@ -383,7 +393,7 @@ public void extractMMCInstance() {
383393
"installer.multimc.text.*", BuildConfig.FOXLOADER_VERSION, BuildConfig.REINDEV_VERSION), false);
384394
}
385395

386-
public void doSilentInstall() throws IOException {
396+
public void doSilentInstall(String arg) throws IOException {
387397
if (this.checkInstaller()) {
388398
return;
389399
}
@@ -393,7 +403,11 @@ public void doSilentInstall() throws IOException {
393403
return;
394404
}
395405
case BETA_CRAFT: {
396-
this.installBetaCraft();
406+
if (arg == null) {
407+
this.installBetaCraft();
408+
} else {
409+
this.installBetaCraftEx(new File(arg));
410+
}
397411
if (progressBar.getValue() != PROGRESS_BAR_MAX) {
398412
System.exit(-1);
399413
return;

final/src/main/java/com/fox2code/foxloader/installer/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ public static void main(String[] args) throws ReflectiveOperationException, Malf
8787
LauncherType.valueOf(args[1].toUpperCase(Locale.ROOT));
8888
try {
8989
System.out.println("Updating...");
90-
new InstallerGUI(installerPlatform, launcherType).doSilentInstall();
90+
new InstallerGUI(installerPlatform, launcherType)
91+
.doSilentInstall(args.length >= 3 ? args[2] : null);
9192
} catch (IOException e) {
9293
e.printStackTrace();
9394
System.exit(-1);

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.10
6+
foxloader.version=1.2.11
77
foxloader.lastReIndevTransformerChanges=1.2.4
88

99
# ReIndev properties

0 commit comments

Comments
 (0)