Disallow MA commands while conversing (guard for Setup Mode).

This commit is contained in:
garbagemule 2014-05-06 01:13:02 +02:00
parent fb4bf3ad27
commit 9e3848ce41

View File

@ -12,6 +12,8 @@ import com.garbagemule.MobArena.commands.user.*;
import com.garbagemule.MobArena.commands.admin.*; import com.garbagemule.MobArena.commands.admin.*;
import com.garbagemule.MobArena.commands.setup.*; import com.garbagemule.MobArena.commands.setup.*;
import com.garbagemule.MobArena.framework.ArenaMaster; import com.garbagemule.MobArena.framework.ArenaMaster;
import org.bukkit.conversations.Conversable;
import org.bukkit.entity.Player;
public class CommandHandler implements CommandExecutor public class CommandHandler implements CommandExecutor
{ {
@ -33,6 +35,11 @@ public class CommandHandler implements CommandExecutor
String base = (args.length > 0 ? args[0] : ""); String base = (args.length > 0 ? args[0] : "");
String last = (args.length > 0 ? args[args.length - 1] : ""); String last = (args.length > 0 ? args[args.length - 1] : "");
// If the player is in a convo (Setup Mode), bail
if (sender instanceof Conversable && ((Conversable) sender).isConversing()) {
return true;
}
// If there's no base argument, show a helpful message. // If there's no base argument, show a helpful message.
if (base.equals("")) { if (base.equals("")) {
Messenger.tell(sender, Msg.MISC_HELP); Messenger.tell(sender, Msg.MISC_HELP);