Allow client commands to control whether they can be invoked without prefix. (#3847)

This commit is contained in:
diesieben07 authored and LexManos committed 2017-05-01 17:22:53 -07:00
1 parent e4d04afd95
commit b2e3f353df
2 files changed
+42 -2

No files matched your search

@@ -59,7 +59,8 @@ public class ClientCommandHandler extends CommandHandler
{
message = message.trim();
if (message.startsWith("/"))
boolean usedSlash = message.startsWith("/");
if (usedSlash)
{
message = message.substring(1);
}
@@ -72,7 +73,7 @@ public class ClientCommandHandler extends CommandHandler
try
{
if (icommand == null)
if (icommand == null || (!usedSlash && icommand instanceof IClientCommand && !((IClientCommand)icommand).allowUsageWithoutPrefix(sender, message)))
{
return 0;
}