fix: make stop and restart work correctly when a player runs it instead of console
This commit is contained in:
@@ -1 +1 @@
|
||||
3507
|
||||
3517
|
||||
@@ -25,7 +25,10 @@ public class RestartCommand extends Command {
|
||||
|
||||
final String reason = context.getString(true, false);
|
||||
|
||||
Main.stop(12, reason.isEmpty() ? null : reason, I18nUtilities.get("info.restarting"));
|
||||
new Thread(
|
||||
() -> Main.stop(12, reason.isEmpty() ? null : reason, I18nUtilities.get("info.restarting")),
|
||||
"ChomeNS Bot Shutdown Thread"
|
||||
).start();
|
||||
|
||||
return Component.translatable("commands.restart.output", bot.colorPalette.defaultColor);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,10 @@ public class StopCommand extends Command {
|
||||
|
||||
final String reason = context.getString(true, false);
|
||||
|
||||
Main.stop(0, reason.isEmpty() ? null : reason);
|
||||
new Thread(
|
||||
() -> Main.stop(0, reason.isEmpty() ? null : reason),
|
||||
"ChomeNS Bot Shutdown Thread"
|
||||
).start();
|
||||
|
||||
return Component.translatable("commands.stop.output", bot.colorPalette.defaultColor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user