Merge branch 'master' into 1.17

This commit is contained in:
gnembon committed 2021-03-09 19:41:49 -04:00
commit 5c4744a93b
26 files changed
+497 -99

No files matched your search

+11 -5
View File
@@ -417,20 +417,26 @@ public class CarpetSettings
private static class ModulePermissionLevel extends Validator<String> {
@Override public String validate(ServerCommandSource source, ParsedRule<String> currentRule, String newValue, String string) {
CarpetSettings.runPermissionLevel = SettingsManager.getCommandLevel(newValue);
int permissionLevel = SettingsManager.getCommandLevel(newValue);
if (source != null && !source.hasPermissionLevel(permissionLevel))
return null;
CarpetSettings.runPermissionLevel = permissionLevel;
CarpetServer.settingsManager.notifyPlayersCommandsChanged();
return newValue;
}
@Override
public String description() { return "Also controls permission level of commands executed via `run()`";}
public String description() { return "When changing the rule, you must at least have the permission level you are trying to give it";}
}
@Rule(
desc = "Enables restrictions for arbitrary code execution with scarpet",
extra = {
"Users that don't have this permission level",
"won't be able to load apps or /script run"
"won't be able to load apps or /script run.",
"It is also the permission level apps will",
"have when running commands with run()"
},
category = {COMMAND, SCARPET},
validate = ModulePermissionLevel.class
category = {SCARPET},
validate = {Validator._COMMAND_LEVEL_VALIDATOR.class, ModulePermissionLevel.class}
)
public static String commandScriptACE = "ops";