Skip to content

Commit

Permalink
Update 1.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox2Code committed Aug 4, 2023
1 parent 548e2bf commit b922df1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
2 changes: 1 addition & 1 deletion betacraft/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ dependencies {
}

tasks.withType(Jar) {
exclude('org/betacraft/*')
exclude('org/*')
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.fox2code.foxloader.launcher.LauncherType;
import com.fox2code.foxloader.launcher.utils.NetUtils;
import com.fox2code.foxloader.launcher.utils.Platform;
import com.fox2code.foxloader.launcher.utils.SourceUtil;
import com.fox2code.foxloader.loader.packet.ClientHello;
import com.fox2code.foxloader.loader.packet.ServerHello;
import com.fox2code.foxloader.network.NetworkPlayer;
Expand Down Expand Up @@ -87,10 +88,20 @@ void loaderHandleDoFoxLoaderUpdate(String version, String url) throws IOExceptio
switch (launcherType) {
default:
return;
case BETA_CRAFT:
File betacraftSource = SourceUtil.getSourceFile(ClientModLoader.class).getParentFile();
String endPath = ".betacraft/versions";
String path = betacraftSource.getPath();
if (!path.replace('\\', '/').endsWith(endPath)) {
this.getLogger().warning("Not BetaCraft?");
return;
}
args = new String[]{null, "-jar", null, "--update", launcherType.name(),
path.substring(0, path.length() - endPath.length())};
break;
case MMC_LIKE:
File libraries = ModLoader.foxLoader.file.getParentFile();
dest = new File(libraries, "foxloader-" + version + ".jar");
case BETA_CRAFT:
case VANILLA_LIKE:
args = new String[]{null, "-jar", null, "--update", launcherType.name()};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,20 @@ public void installMineCraft() {
}

public void installBetaCraft() {
File betacraft = Platform.getAppDir("betacraft");
if (!betacraft.exists()) {
File betacraftPortable = new File(".betacraft").getAbsoluteFile();
if (betacraftPortable.exists()) {
betacraft = betacraftPortable;
}
}
this.installBetaCraftEx(betacraft);
}

public void installBetaCraftEx(File betaCraft) {
if (this.checkInstaller()) {
return;
}
File betaCraft = Platform.getAppDir("betacraft");
File versions = new File(betaCraft, "versions");
File versionsJsons = new File(versions, "jsons");
File launchMethods = new File(betaCraft,
Expand Down Expand Up @@ -383,7 +393,7 @@ public void extractMMCInstance() {
"installer.multimc.text.*", BuildConfig.FOXLOADER_VERSION, BuildConfig.REINDEV_VERSION), false);
}

public void doSilentInstall() throws IOException {
public void doSilentInstall(String arg) throws IOException {
if (this.checkInstaller()) {
return;
}
Expand All @@ -393,7 +403,11 @@ public void doSilentInstall() throws IOException {
return;
}
case BETA_CRAFT: {
this.installBetaCraft();
if (arg == null) {
this.installBetaCraft();
} else {
this.installBetaCraftEx(new File(arg));
}
if (progressBar.getValue() != PROGRESS_BAR_MAX) {
System.exit(-1);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public static void main(String[] args) throws ReflectiveOperationException, Malf
LauncherType.valueOf(args[1].toUpperCase(Locale.ROOT));
try {
System.out.println("Updating...");
new InstallerGUI(installerPlatform, launcherType).doSilentInstall();
new InstallerGUI(installerPlatform, launcherType)
.doSilentInstall(args.length >= 3 ? args[2] : null);
} catch (IOException e) {
e.printStackTrace();
System.exit(-1);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.parallel=true
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8

# FoxLoader properties
foxloader.version=1.2.10
foxloader.version=1.2.11
foxloader.lastReIndevTransformerChanges=1.2.4

# ReIndev properties
Expand Down

0 comments on commit b922df1

Please sign in to comment.