diff --git a/Bukkit/build.gradle b/Bukkit/build.gradle index 8b4503914..f14fd18cb 100644 --- a/Bukkit/build.gradle +++ b/Bukkit/build.gradle @@ -42,7 +42,7 @@ dependencies { compile("se.hyperver.hyperverse:Core:0.6.0-SNAPSHOT"){ transitive = false } compile('com.sk89q:squirrelid:1.0.0-SNAPSHOT'){ transitive = false } compile('be.maximvdw:MVdWPlaceholderAPI:3.1.1'){ transitive = false } - implementation("org.incendo.serverlib:ServerLib:2.1.0") + implementation("org.incendo.serverlib:ServerLib:2.2.0") } sourceCompatibility = 1.8 @@ -102,7 +102,7 @@ shadowJar { include(dependency("org.khelekore:prtree:1.7.0-SNAPSHOT")) include(dependency("com.sk89q:squirrelid:1.0.0-SNAPSHOT")) include(dependency("com.intellectualsites.paster:Paster:1.0.2-SNAPSHOT")) - include(dependency("org.incendo.serverlib:ServerLib:2.1.0")) + include(dependency("org.incendo.serverlib:ServerLib:2.2.0")) } relocate('net.kyori.text', 'com.plotsquared.formatting.text') relocate("io.papermc.lib", "com.plotsquared.bukkit.paperlib") diff --git a/Bukkit/pom.xml b/Bukkit/pom.xml index a42a6fa55..76c10a368 100644 --- a/Bukkit/pom.xml +++ b/Bukkit/pom.xml @@ -185,7 +185,7 @@ org.incendo.serverlib ServerLib - 2.1.0 + 2.2.0 runtime diff --git a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java index 3591b7354..fe3ba0862 100644 --- a/Core/src/main/java/com/plotsquared/core/command/DebugExec.java +++ b/Core/src/main/java/com/plotsquared/core/command/DebugExec.java @@ -109,8 +109,10 @@ public class DebugExec extends SubCommand { } public ScriptEngine getEngine() { - if (this.engine == null) { - init(); + if (!Settings.Enabled_Components.DISABLE_NASHORN_SCRIPT_ENGINE) { + if (this.engine == null) { + init(); + } } return this.engine; } diff --git a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java index d52ac7a99..90f451172 100644 --- a/Core/src/main/java/com/plotsquared/core/command/MainCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/MainCommand.java @@ -107,7 +107,6 @@ public class MainCommand extends Command { new Music(); new DebugRoadRegen(); new Trust(); - new DebugExec(); new FlagCommand(); new Target(); new Move(); @@ -139,6 +138,10 @@ public class MainCommand extends Command { // Referenced commands instance.toggle = new Toggle(); instance.help = new Help(instance); + + if (!Settings.Enabled_Components.DISABLE_NASHORN_SCRIPT_ENGINE) { + new DebugExec(); + } } return instance; } diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 988821265..b2bc1b6ce 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -593,6 +593,12 @@ public class Settings extends Config { public static List TAB_COMPLETED_ALIASES = Arrays.asList("plot", "plots", "p", "plotsquared", "plot2", "p2", "ps", "2", "plotme", "plotz", "ap"); @Comment("Whether PlotSquared should hook into MvDWPlaceholderAPI or not") public static boolean USE_MVDWAPI = true; + @Comment({"Whether the Nashorn scripting engine should be enabled or not. Disabling this will ensure compatibility with Java 15+ by sacrificing scripting via Nashorn.", + "This is a temporary option going to be removed within the next major release (1.17/v6) where this issue has been addressed sanely without sacrifices but allowing you to update your Java version beforehand without loosing half of PlotSquared's commands.", + "By setting the following to true you eliminate:", + " - The functionality to use javascript in the worlds.yml prices' section", + " - The `/plot debugexec` command"}) + public static boolean DISABLE_NASHORN_SCRIPT_ENGINE = false; } }