Add missing killcount command config (#4489)
Add missing toggle for enabling !kc command to chat commands config
This commit is contained in:
@@ -66,6 +66,17 @@ public interface ChatCommandsConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 3,
|
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",
|
keyName = "clearShortcuts",
|
||||||
name = "Clear shortcuts",
|
name = "Clear shortcuts",
|
||||||
description = "Enable shortcuts (ctrl+w and backspace) for clearing the chatbox"
|
description = "Enable shortcuts (ctrl+w and backspace) for clearing the chatbox"
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
|||||||
log.debug("Running clue lookup for {}", search);
|
log.debug("Running clue lookup for {}", search);
|
||||||
executor.submit(() -> playerClueLookup(setMessage, 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);
|
String search = message.substring(4);
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
|||||||
public boolean onChatboxInput(ChatboxInput chatboxInput)
|
public boolean onChatboxInput(ChatboxInput chatboxInput)
|
||||||
{
|
{
|
||||||
final String value = chatboxInput.getValue();
|
final String value = chatboxInput.getValue();
|
||||||
if (!value.startsWith("!kc ") && !value.startsWith("/!kc "))
|
if (!config.killcount() || !value.startsWith("!kc ") && !value.startsWith("/!kc "))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -361,7 +361,7 @@ public class ChatCommandsPlugin extends Plugin implements ChatboxInputListener
|
|||||||
public boolean onPrivateMessageInput(PrivateMessageInput privateMessageInput)
|
public boolean onPrivateMessageInput(PrivateMessageInput privateMessageInput)
|
||||||
{
|
{
|
||||||
final String message = privateMessageInput.getMessage();
|
final String message = privateMessageInput.getMessage();
|
||||||
if (!message.startsWith("!kc "))
|
if (!config.killcount() || !message.startsWith("!kc "))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user