Fix verbose system

This commit is contained in:
Luck 2016-11-05 19:19:29 +00:00
parent 2dd0858960
commit 981d745b74
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 12 additions and 16 deletions

View File

@ -35,7 +35,7 @@ import java.util.stream.Collectors;
public class VerboseCommand extends SingleMainCommand {
public VerboseCommand() {
super("Verbose", "/%s verbose <true|false> [filters]", 1, Permission.VERBOSE);
super("Verbose", "/%s verbose <true|false> [filters...]", 1, Permission.VERBOSE);
}
@Override
@ -58,7 +58,7 @@ public class VerboseCommand extends SingleMainCommand {
List<String> filters = new ArrayList<>();
if (args.size() != 1) {
filters.addAll(args.subList(1, args.size() + 1));
filters.addAll(args.subList(1, args.size()));
}

View File

@ -39,22 +39,18 @@ public class DebugHandler {
private final Map<Reciever, List<String>> listeners = new ConcurrentHashMap<>();
public void printOutput(String checked, String node, Tristate value) {
all:
for (Map.Entry<Reciever, List<String>> e : listeners.entrySet()) {
List<String> filters = e.getValue();
find:
if (!filters.isEmpty()) {
for (String filter : filters) {
if (node.toLowerCase().startsWith(filter.toLowerCase())) {
break find;
}
if (checked.equalsIgnoreCase(filter)) {
break find;
}
for (String filter : e.getValue()) {
if (node.toLowerCase().startsWith(filter.toLowerCase())) {
continue;
}
continue;
if (checked.equalsIgnoreCase(filter)) {
continue;
}
continue all;
}
Message.LOG.send(e.getKey().getSender(), "&7Checking &a" + checked + "&7 for: &a" + node + " &f(&7" + value.toString() + "&f)");

View File

@ -46,7 +46,7 @@ use-uninherit-command: "Use the 'parent remove' command instead of specifying th
verbose-on: "&bVerbose checking output set to &aTRUE &bfor all permissions."
verbose-on_query: "&bVerbose checking output set to &aTRUE &bfor permissions starting with &f\"{0}\"&b."
verbose-on_query: "&bVerbose checking output set to &aTRUE &bfor permissions matching the following filters: &f{0}"
verbose-off: "&bVerbose checking output set to &cFALSE&b."
create-success: "&b{0}&a was successfully created."