ops options for commands

This commit is contained in:
gnembon committed 2019-12-01 01:04:58 -04:00
1 parent c2f22a141a
commit b52b5c335f
16 files changed
+133 -51

No files matched your search

@@ -185,6 +185,23 @@ public class SettingsManager
}));
}
public static boolean canUseCommand(ServerCommandSource source, String commandLevel)
{
switch (commandLevel)
{
case "true": return true;
case "false": return false;
case "ops": return source.hasPermissionLevel(2); // typical for other cheaty commands
case "0":
case "1":
case "2":
case "3":
case "4":
return source.hasPermissionLevel(Integer.parseInt(commandLevel));
}
return false;
}
private void loadConfigurationFromConf()
{
for (ParsedRule<?> rule : rules.values()) rule.resetToDefault(server.getCommandSource());