Skip to content

Commit

Permalink
feat: Require any ConsoleCommandSender for the shutdown command (Pape…
Browse files Browse the repository at this point in the history
  • Loading branch information
Timongcraft authored and pull[bot] committed Sep 14, 2024
1 parent db21774 commit 9efe6bb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.velocitypowered.api.command.BrigadierCommand;
import com.velocitypowered.api.command.CommandSource;
import com.velocitypowered.api.proxy.ConsoleCommandSource;
import com.velocitypowered.proxy.VelocityServer;
import net.kyori.adventure.text.minimessage.MiniMessage;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
Expand All @@ -43,7 +44,7 @@ private ShutdownCommand() {
*/
public static BrigadierCommand command(final VelocityServer server) {
return new BrigadierCommand(LiteralArgumentBuilder.<CommandSource>literal("shutdown")
.requires(source -> source == server.getConsoleCommandSource())
.requires(source -> source instanceof ConsoleCommandSource)
.executes(context -> {
server.shutdown(true);
return Command.SINGLE_SUCCESS;
Expand Down

0 comments on commit 9efe6bb

Please sign in to comment.