mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Add toggle allowing to opt out nashorn
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -593,6 +593,12 @@ public class Settings extends Config {
|
||||
public static List<String> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user