geforkt von Mirrors/Velocity
Allow users to specify a reason in the shutdown command
Dieser Commit ist enthalten in:
Ursprung
941800ce96
Commit
9f340347b6
@ -5,6 +5,7 @@ import com.velocitypowered.api.command.CommandSource;
|
|||||||
import com.velocitypowered.proxy.VelocityServer;
|
import com.velocitypowered.proxy.VelocityServer;
|
||||||
import net.kyori.text.TextComponent;
|
import net.kyori.text.TextComponent;
|
||||||
import net.kyori.text.format.TextColor;
|
import net.kyori.text.format.TextColor;
|
||||||
|
import net.kyori.text.serializer.legacy.LegacyComponentSerializer;
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
public class ShutdownCommand implements Command {
|
public class ShutdownCommand implements Command {
|
||||||
@ -17,7 +18,12 @@ public class ShutdownCommand implements Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(CommandSource source, String @NonNull [] args) {
|
public void execute(CommandSource source, String @NonNull [] args) {
|
||||||
|
if (args.length == 0) {
|
||||||
server.shutdown(true);
|
server.shutdown(true);
|
||||||
|
} else {
|
||||||
|
String reason = String.join(" ", args);
|
||||||
|
server.shutdown(true, LegacyComponentSerializer.legacy().deserialize(reason, '&'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren