From f474d2b68814224b32d9b3dea17f89e309bbd725 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 22 Dec 2025 18:34:25 -0500 Subject: [PATCH] Java 25 packr JDK compatibility --- .../src/mindustry/ui/dialogs/CampaignRulesDialog.java | 5 ----- desktop/build.gradle | 11 ++++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/ui/dialogs/CampaignRulesDialog.java b/core/src/mindustry/ui/dialogs/CampaignRulesDialog.java index bcbc4eebe8..8a978635ec 100644 --- a/core/src/mindustry/ui/dialogs/CampaignRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CampaignRulesDialog.java @@ -77,11 +77,6 @@ public class CampaignRulesDialog extends BaseDialog{ if(!planet.clearSectorOnLose){ check("@rules.clearsectoronloss", b -> rules.clearSectorOnLose = b, () -> rules.clearSectorOnLose); } - - //TODO: this is intentionally hidden until the new mechanics have been well-tested. I don't want people immediately switching to the old mechanics - if(planet.allowLegacyLaunchPads){ - // check("@rules.legacylaunchpads", b -> rules.legacyLaunchPads = b, () -> rules.legacyLaunchPads); - } }).growY(); } diff --git a/desktop/build.gradle b/desktop/build.gradle index b3f192bc75..43d07183bb 100644 --- a/desktop/build.gradle +++ b/desktop/build.gradle @@ -57,6 +57,8 @@ task dist(type: Jar, dependsOn: configurations.runtimeClasspath){ manifest{ attributes 'Main-Class': project.mainClassName + //note: this doesn't do anything when launched from the bundled JVM + attributes 'Enable-Native-Access': 'ALL-UNNAMED' } } @@ -142,12 +144,16 @@ platforms.each{ platform -> args += "Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1" args += "XX:+ShowCodeDetailsInExceptionMessages" + args += "XX:+UseCompactObjectHeaders" + args += "enable-native-access=ALL-UNNAMED" exec{ commandLine args.toList() standardOutput = System.out } + def outputJsonFile = platform != "MacOS" ? file("build/packr/output/Mindustry.json") : file("build/packr/output/${appName}.app/Contents/Resources/Mindustry.json") + if(platform != "MacOS"){ copy{ into "build/packr/output/jre/" @@ -158,7 +164,7 @@ platforms.each{ platform -> delete "build/packr/output/desktop.jar" } - file("build/packr/output/Mindustry.json").text = file("build/packr/output/Mindustry.json").text.replace("desktop.jar", "jre/desktop.jar") + outputJsonFile.text = outputJsonFile.text.replace("desktop.jar", "jre/desktop.jar") }else{ copy{ into "build/packr/output/${appName}.app/Contents/" @@ -169,6 +175,9 @@ platforms.each{ platform -> delete "build/packr/output/Contents/" } } + + //packr is broken and won't let me add one hyphen,so I have to do that myself later + outputJsonFile.text = outputJsonFile.text.replace("-enable-native-access=ALL-UNNAMED", "--enable-native-access=ALL-UNNAMED") } if((platform == "Windows64" || platform == "Windows32")){