From 9e3848ce4152627ab6e6cbaee0d3dd4fec2b9017 Mon Sep 17 00:00:00 2001 From: garbagemule Date: Tue, 6 May 2014 01:13:02 +0200 Subject: [PATCH] Disallow MA commands while conversing (guard for Setup Mode). --- src/com/garbagemule/MobArena/commands/CommandHandler.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/com/garbagemule/MobArena/commands/CommandHandler.java b/src/com/garbagemule/MobArena/commands/CommandHandler.java index f3c1792..e659be1 100644 --- a/src/com/garbagemule/MobArena/commands/CommandHandler.java +++ b/src/com/garbagemule/MobArena/commands/CommandHandler.java @@ -12,6 +12,8 @@ import com.garbagemule.MobArena.commands.user.*; import com.garbagemule.MobArena.commands.admin.*; import com.garbagemule.MobArena.commands.setup.*; import com.garbagemule.MobArena.framework.ArenaMaster; +import org.bukkit.conversations.Conversable; +import org.bukkit.entity.Player; public class CommandHandler implements CommandExecutor { @@ -32,6 +34,11 @@ public class CommandHandler implements CommandExecutor // Grab the base and arguments. String base = (args.length > 0 ? args[0] : ""); 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 (base.equals("")) {