Add support for string message with messagetype

This commit is contained in:
Ben Woo 2023-09-20 11:53:30 +08:00
parent db0d5da5ce
commit d422c240cf
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -1,5 +1,6 @@
package org.mvplugins.multiverse.core.commandtools; package org.mvplugins.multiverse.core.commandtools;
import co.aikar.commands.MessageKeys;
import co.aikar.commands.MessageType; import co.aikar.commands.MessageType;
import co.aikar.commands.OpenBukkitCommandIssuer; import co.aikar.commands.OpenBukkitCommandIssuer;
import co.aikar.locales.MessageKeyProvider; import co.aikar.locales.MessageKeyProvider;
@ -22,6 +23,23 @@ public class MVCommandIssuer extends OpenBukkitCommandIssuer {
return commandManager; return commandManager;
} }
public void sendError(String message) {
sendMessage(MessageType.ERROR, message);
}
public void sendSyntax(String message) {
sendMessage(MessageType.SYNTAX, message);
}
public void sendInfo(String message) {
sendMessage(MessageType.INFO, message);
}
public void sendMessage(MessageType messageType, String message) {
getManager().sendMessage(this, messageType, MessageKeys.INFO_MESSAGE,
"{message}", message);
}
public void sendError(Message message) { public void sendError(Message message) {
sendMessage(MessageType.ERROR, message); sendMessage(MessageType.ERROR, message);
} }