Bleeding - Fixed empty commands

Empty commands would always run the first alphabetically sorted TFM command.
This commit is contained in:
Jerom van der Sar 2013-07-12 21:51:03 +02:00
parent f21e50e002
commit 8f6d71fffb
4 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,5 @@
#Wed, 10 Jul 2013 23:43:28 +0200 #Wed, 10 Jul 2013 23:58:09 +0200
program.VERSION=2.21 program.VERSION=2.21
program.BUILDNUM=297 program.BUILDNUM=301
program.BUILDDATE=07/10/2013 11\:43 PM program.BUILDDATE=07/10/2013 11\:58 PM

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Wed Jul 10 23:43:28 CEST 2013 #Wed Jul 10 23:58:09 CEST 2013
build.number=298 build.number=302

View File

@ -14,6 +14,11 @@ public class Command_adminmode extends TFM_Command
@Override @Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
if (args.length != 1)
{
return false;
}
if (args[0].equalsIgnoreCase("off")) if (args[0].equalsIgnoreCase("off"))
{ {
TotalFreedomMod.adminOnlyMode = false; TotalFreedomMod.adminOnlyMode = false;

View File

@ -160,6 +160,11 @@ public class TotalFreedomMod extends JavaPlugin
StringUtils.join(args, " ")), true); StringUtils.join(args, " ")), true);
} }
if ("".equals(commandLabel))
{
return false;
}
TFM_Command dispatcher; TFM_Command dispatcher;
try try
{ {