Add missing killcount command config (#4489)

Add missing toggle for enabling !kc command to chat commands config
This commit is contained in:
Juul Damen
2018-07-30 08:09:21 +02:00
committed by Tomas Slusny
parent fb72406100
commit 326890cb7a
2 changed files with 14 additions and 3 deletions

View File

@@ -66,6 +66,17 @@ public interface ChatCommandsConfig extends Config
@ConfigItem(
position = 3,
keyName = "killcount",
name = "Killcount Command",
description = "Configures whether the Killcount command is enabled"
)
default boolean killcount()
{
return true;
}
@ConfigItem(
position = 4,
keyName = "clearShortcuts",
name = "Clear shortcuts",
description = "Enable shortcuts (ctrl+w and backspace) for clearing the chatbox"

View File

@@ -215,7 +215,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
log.debug("Running clue lookup for {}", search);
executor.submit(() -> playerClueLookup(setMessage, search));
}
else if (message.toLowerCase().startsWith("!kc "))
else if (config.killcount() && message.toLowerCase().startsWith("!kc "))
{
String search = message.substring(4);
@@ -322,7 +322,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
public boolean onChatboxInput(ChatboxInput chatboxInput)
{
final String value = chatboxInput.getValue();
if (!value.startsWith("!kc ") && !value.startsWith("/!kc "))
if (!config.killcount() || !value.startsWith("!kc ") && !value.startsWith("/!kc "))
{
return false;
}
@@ -361,7 +361,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
public boolean onPrivateMessageInput(PrivateMessageInput privateMessageInput)
{
final String message = privateMessageInput.getMessage();
if (!message.startsWith("!kc "))
if (!config.killcount() || !message.startsWith("!kc "))
{
return false;
}