mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
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.
This commit is contained in:
parent
24dfac65b2
commit
0fa3d0e8d1
@ -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 {
|
|||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user