fix botvis and command handler + console commands colors

This commit is contained in:
ChomeNS 2023-03-24 09:21:05 +07:00
parent 6e2eb9ec74
commit 1f36cd9959
3 changed files with 5 additions and 2 deletions

View file

@ -15,7 +15,7 @@ public class ConsoleCommandContext extends CommandContext {
@Override
public void sendOutput (Component component) {
final String message = ComponentUtilities.stringify(component);
final String message = ComponentUtilities.stringifyAnsi(component);
bot.logger().log(message);
}

View file

@ -41,7 +41,7 @@ public class BotVisibilityCommand implements Command {
public Component execute(CommandContext context, String[] args, String[] fullArgs) {
final Bot bot = context.bot();
if (args[0] == null) {
if (args.length == 0) {
final boolean visibility = bot.selfCare().visibility();
bot.selfCare().visibility(!visibility);
@ -58,6 +58,7 @@ public class BotVisibilityCommand implements Command {
switch (args[0]) {
case "on", "true" -> {
bot.selfCare().visibility(true);
bot.chat().send("/essentials:vanish disable");
context.sendOutput(
Component.empty()
.append(Component.text("The bot's visibility is now "))
@ -66,6 +67,7 @@ public class BotVisibilityCommand implements Command {
}
case "off", "false" -> {
bot.selfCare().visibility(false);
bot.chat().send("/essentials:vanish enable");
context.sendOutput(
Component.empty()
.append(Component.text("The bot's visibility is now "))

View file

@ -112,6 +112,7 @@ public class CommandHandlerPlugin {
count++;
}
}
if (usage.contains("<hash>")) count--; // bad fix?
return count;
}