Skip to content

Commit

Permalink
Add a deprecation notice to the java launcher and point it to the new…
Browse files Browse the repository at this point in the history
… archive repository.
  • Loading branch information
IntegratedQuantum committed Apr 6, 2024
1 parent 84ab813 commit 2a3d17a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/io/cubyz/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public static void main(String[] args) {
// Prompt the user to update:
JOptionPane.showMessageDialog(null, "A new update of launcher is available.", "information", JOptionPane.INFORMATION_MESSAGE);
} catch(Exception e) {}
JOptionPane.showMessageDialog(null, "The Java version of the game and the Java launcher are deprecated and will no longer receive any updates. Newer versions of the game are available in the Zig version.", "information", JOptionPane.INFORMATION_MESSAGE);
GitHubConnection.downloadReleaseData();
new MainGUI();
}
Expand Down
20 changes: 10 additions & 10 deletions src/io/cubyz/github/GitHubConnection.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static void downloadReleaseData() {
if(file.exists()) continue;

// Tests if the version `i` is available if so reads the file, otherwise throws an Exception.
String link = "https://github.com/PixelGuys/Cubyz/releases/download/R"+i+"/release_info";
String link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/R"+i+"/release_info";
URL url = new URL(link);
ReadableByteChannel rbc = Channels.newChannel(url.openStream());
new File(System.getProperty("user.home") + "/.cubyz/" + "R" + i).mkdirs(); // Create the directory.
Expand All @@ -53,7 +53,7 @@ public static BufferedImage readOrDownloadImage(File folder) {
if(!imageLocation.exists()) {
// Download the image:
String tag = folder.getName();
String link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/image.png";
String link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/image.png";
try {
DownloadAndFileManager.downloadToFile(imageLocation, link);
} catch(IOException e) {
Expand All @@ -72,15 +72,15 @@ public static void downloadAndLaunchRelease(File folder) {
// The game files need to be downloaded.

// Addons folder:
String link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/addons.zip";
String link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/addons.zip";
try {
DownloadAndFileManager.downloadAndUnzip(folder, link);
} catch(IOException e) {
// That's normal behaviour. Not every release needs this folder.
}

// Assets folder:
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/assets.zip";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/assets.zip";
try {
DownloadAndFileManager.downloadAndUnzip(folder, link);
} catch(IOException e) {
Expand All @@ -90,26 +90,26 @@ public static void downloadAndLaunchRelease(File folder) {
}

// Dependencies:
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/pom.xml";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/pom.xml";
DependencyManager.fetchDependencies(link, System.getProperty("user.home") + "/.cubyz", new File(folder, "pom.xml"));

// And finally the jar file. This is downloaded last to reduce potential issues when the user closes the application before everything is done.
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/Cubyz.jar";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/Cubyz.jar";
try {
DownloadAndFileManager.downloadToFile(jarLocation, link);
} catch(IOException e) {
try {
// The old version 0.6.0 packaged the libraries into the jar file, so there are multiple files for each OS and arch:
if(SystemInfo.OS_FAMILY.equals("windows")) {
if(SystemInfo.OS_ARCH.contains("64")) {
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/Cubyz_win_64.jar";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/Cubyz_win_64.jar";
} else {
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/Cubyz_win_x86.jar";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/Cubyz_win_x86.jar";
}
DownloadAndFileManager.downloadToFile(jarLocation, link);
} else if(SystemInfo.OS_FAMILY.equals("unix")) {
if(SystemInfo.OS_ARCH.contains("64")) {
link = "https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/Cubyz_win_64.jar";
link = "https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/Cubyz_win_64.jar";
DownloadAndFileManager.downloadToFile(jarLocation, link);
}
}
Expand All @@ -123,7 +123,7 @@ public static void downloadAndLaunchRelease(File folder) {
}

// Build the classpath:
ArrayList<String> libs = DependencyManager.fetchDependencies("https://github.com/PixelGuys/Cubyz/releases/download/"+tag+"/pom.xml", System.getProperty("user.home") + "/.cubyz", new File(folder, "pom.xml"));
ArrayList<String> libs = DependencyManager.fetchDependencies("https://github.com/PixelGuys/Cubyz-Java/releases/download/"+tag+"/pom.xml", System.getProperty("user.home") + "/.cubyz", new File(folder, "pom.xml"));

int minJavaVersion = DependencyManager.findJavaVersion(new File(folder, "pom.xml"));
if(minJavaVersion > SystemInfo.JAVA_VERSION) {
Expand Down

0 comments on commit 2a3d17a

Please sign in to comment.