mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-27 04:55:25 +01:00
Disallow MA commands while conversing (guard for Setup Mode).
This commit is contained in:
parent
fb4bf3ad27
commit
9e3848ce41
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user