From f1d186df077726a8234c288694ff07e52b41524b Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Thu, 9 Jan 2025 22:52:59 -0800 Subject: [PATCH] Add RunServer#ignoreUnsupportedJvm --- plugin/build.gradle.kts | 2 +- .../kotlin/xyz/jpenilla/runpaper/task/RunServer.kt | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index f9266be..0805eef 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "xyz.jpenilla" -version = "2.3.2-SNAPSHOT" +version = "2.4.0-SNAPSHOT" description = "Gradle plugins adding run tasks for Minecraft server and proxy software" repositories { diff --git a/plugin/src/main/kotlin/xyz/jpenilla/runpaper/task/RunServer.kt b/plugin/src/main/kotlin/xyz/jpenilla/runpaper/task/RunServer.kt index 425ed0a..a4e8a65 100644 --- a/plugin/src/main/kotlin/xyz/jpenilla/runpaper/task/RunServer.kt +++ b/plugin/src/main/kotlin/xyz/jpenilla/runpaper/task/RunServer.kt @@ -100,6 +100,16 @@ public abstract class RunServer : RunWithPlugins() { return version.get().minecraftVersionIsSameOrNewerThan(1, 16, 5) } + /** + * Sets the Paper system property to ignore unsupported JVM runtimes. + * Can allow running older Paper builds on newer JVMs. + * + * This may have mixed results based on plugins, Paper version, and more. + */ + public fun ignoreUnsupportedJvm() { + systemProperty("Paper.IgnoreJavaVersion", true) + } + /** * Sets the Minecraft version to use. *