Commit 0fa3d0e8 authored by AnimeGitB's avatar AnimeGitB Committed by Melledy
Browse files

Improve message formatting to clients

Replaces tab indents with an extra linebreak.
Also adds / to the start of command usage.
Neither of these changes affect messages to the server console log.
parent 24dfac65
...@@ -28,7 +28,7 @@ public interface CommandHandler { ...@@ -28,7 +28,7 @@ public interface CommandHandler {
if (player == null) { if (player == null) {
Grasscutter.getLogger().info(event.getMessage()); Grasscutter.getLogger().info(event.getMessage());
} else { } else {
player.dropMessage(event.getMessage()); player.dropMessage(event.getMessage().replace("\n\t", "\n\n"));
} }
} }
...@@ -44,6 +44,9 @@ public interface CommandHandler { ...@@ -44,6 +44,9 @@ public interface CommandHandler {
if (alias.length() < command.length()) if (alias.length() < command.length())
command = alias; command = alias;
} }
if (player != null) {
command = "/" + command;
}
String target = switch (annotation.targetRequirement()) { String target = switch (annotation.targetRequirement()) {
case NONE -> ""; case NONE -> "";
case OFFLINE -> "@<UID> "; // TODO: make translation keys for offline and online players case OFFLINE -> "@<UID> "; // TODO: make translation keys for offline and online players
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment