Skip to content

Commit

Permalink
Bump api version, fix Java 22 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Jun 1, 2024
1 parent 430a509 commit ca30ff4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public class Launcher {
private static final int MIN_CLASS_VERSION = 61;
private static final int MIN_JAVA_VERSION = 17;

private static final int MAX_CLASS_VERSION = 66;
private static final int MAX_JAVA_VERSION = 22;

public static void main(String[] args) throws Throwable {
int javaVersion = (int) Float.parseFloat(System.getProperty("java.class.version"));
if (javaVersion < MIN_CLASS_VERSION) {
Expand All @@ -20,6 +23,13 @@ public static void main(String[] args) throws Throwable {
return;
}

if (javaVersion > MAX_CLASS_VERSION) {
System.err.println("Warning: Arclight is known to be compatible with up to Java " + MAX_JAVA_VERSION + " and may not run on later versions");
System.err.println("Current: " + System.getProperty("java.version"));
System.err.flush();
Thread.sleep(3000);
}

try (InputStream input = Launcher.class.getResourceAsStream("/META-INF/MANIFEST.MF")) {
Manifest manifest = new Manifest(input);
String target = manifest.getMainAttributes().getValue("Arclight-Target");
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ allprojects {
fabricApiVersion = '0.97.0+1.20.4'
forgeVersion = '49.0.49'
neoForgeVersion = '20.4.234'
apiVersion = '1.6.3'
apiVersion = '1.7.1'
toolsVersion = '1.3.0'
mixinVersion = '0.8.5'
mixinToolsVersion = '1.2.3'
Expand Down

0 comments on commit ca30ff4

Please sign in to comment.