mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 02:55:17 +00:00
Allow client commands to control whether they can be invoked without prefix. (#3847)
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user