From 0f3934710bb7805d1f0af5398cbab35602943d8b Mon Sep 17 00:00:00 2001 From: Dico Date: Thu, 2 Aug 2018 19:10:18 +0100 Subject: Tweak some command output --- .../java/io/dico/dicore/command/chat/AbstractChatController.java | 2 +- src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dicore3/command/src/main/java/io/dico/dicore/command/chat/AbstractChatController.java b/dicore3/command/src/main/java/io/dico/dicore/command/chat/AbstractChatController.java index 52c1e30..d88e852 100644 --- a/dicore3/command/src/main/java/io/dico/dicore/command/chat/AbstractChatController.java +++ b/dicore3/command/src/main/java/io/dico/dicore/command/chat/AbstractChatController.java @@ -36,7 +36,7 @@ public class AbstractChatController implements IChatController { @Override public void sendMessage(CommandSender sender, EMessageType type, String message) { if (message != null && !message.isEmpty()) { - sender.sendMessage(getMessagePrefixForType(type) + getChatFormatForType(type) + message); + sender.sendMessage(filterMessage(getMessagePrefixForType(type) + getChatFormatForType(type) + message)); } } diff --git a/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt b/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt index 769cf5f..5395b1c 100644 --- a/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt +++ b/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt @@ -88,11 +88,13 @@ class CommandsGeneral(plugin: ParcelsPlugin) : AbstractParcelCommands(plugin) { @ParcelRequire(owner = true) fun ParcelScope.cmdClear(context: ExecutionContext, @Flag sure: Boolean): Any? { if (!sure) return "Are you sure? You cannot undo this action!\n" + - "Type ${context.rawInput} -sure if you want to go through with this." + "Run \"/${context.rawInput} -sure\" if you want to go through with this." world.clearParcel(parcel.id) .onProgressUpdate(1000, 1000) { progress, elapsedTime -> - context.sendMessage(EMessageType.INFORMATIVE, "Clear progress: %.02f%%, %.2fs elapsed" + val alt = context.getFormat(EMessageType.NUMBER) + val main = context.getFormat(EMessageType.INFORMATIVE) + context.sendMessage(EMessageType.INFORMATIVE, false, "Clear progress: $alt%.02f$main%%, $alt%.2f${main}s elapsed" .format(progress * 100, elapsedTime / 1000.0)) } -- cgit v1.2.3