Skip to content

Commit

Permalink
Change server_command sender type "type" -> "sendertype"
Browse files Browse the repository at this point in the history
This is a change for the previous commit.
  • Loading branch information
Pieter12345 committed Sep 28, 2018
1 parent 0d5b527 commit 2411a0e
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -66,7 +66,7 @@ public String docs() {
+ " before CommandHelper aliases, allowing you to insert control beforehand. Be careful with this"
+ " event, because it can override ALL server commands, potentially creating all sorts of havoc."
+ "{command: The entire command | prefix: The prefix of the command"
+ " | type: The command sender type. This is one of: console, command_block,"
+ " | sendertype: The command sender type. This is one of: console, command_block,"
+ " command_minecart or null if the sender is unknown to CommandHelper.}"
+ "{command}"
+ "{}";
Expand All @@ -90,7 +90,7 @@ public boolean matches(Map<String, Construct> prefilter, BindableEvent e) throws
MCServerCommandEvent event = (MCServerCommandEvent) e;
String prefix = event.getCommand().split(" ", 2)[0];
Prefilters.match(prefilter, "prefix", prefix, PrefilterType.STRING_MATCH);
Prefilters.match(prefilter, "type",
Prefilters.match(prefilter, "sendertype",
getCommandsenderString(event.getCommandSender()), PrefilterType.STRING_MATCH);
return true;
}
Expand All @@ -113,7 +113,7 @@ public Map<String, Construct> evaluate(BindableEvent e) throws EventException {

// Set the command sender type.
String type = getCommandsenderString(event.getCommandSender());
map.put("type", (type == null ? CNull.NULL : new CString(type, Target.UNKNOWN)));
map.put("sendertype", (type == null ? CNull.NULL : new CString(type, Target.UNKNOWN)));

return map;
}
Expand Down

0 comments on commit 2411a0e

Please sign in to comment.