From afb6e69388a3805a4fd8aa1f97ef60758535bcac Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 24 Aug 2018 21:09:56 -0400 Subject: [PATCH] Improve Javadoc and the GameProfileRequestEvent. --- .../api/command/CommandManager.java | 15 ++++++++++ .../api/event/connection/PreLoginEvent.java | 23 +++++++++++---- .../gameprofile/GameProfileRequestEvent.java | 28 +++++++++++++++---- .../client/LoginSessionHandler.java | 3 +- 4 files changed, 57 insertions(+), 12 deletions(-) diff --git a/api/src/main/java/com/velocitypowered/api/command/CommandManager.java b/api/src/main/java/com/velocitypowered/api/command/CommandManager.java index 38f031716..040c3d295 100644 --- a/api/src/main/java/com/velocitypowered/api/command/CommandManager.java +++ b/api/src/main/java/com/velocitypowered/api/command/CommandManager.java @@ -6,9 +6,24 @@ import org.checkerframework.checker.nullness.qual.NonNull; * Represents an interface to register a command executor with the proxy. */ public interface CommandManager { + /** + * Registers the specified command with the manager with the specified aliases. + * @param command the command to register + * @param aliases the alias to use + */ void register(@NonNull Command command, String... aliases); + /** + * Unregisters a command. + * @param alias the command alias to unregister + */ void unregister(@NonNull String alias); + /** + * Attempts to execute a command from the specified {@code cmdLine}. + * @param source the command's source + * @param cmdLine the command to run + * @return true if the command was found and executed, false if it was not + */ boolean execute(@NonNull CommandSource source, @NonNull String cmdLine); } diff --git a/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java b/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java index 9c052df96..169427850 100644 --- a/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/connection/PreLoginEvent.java @@ -2,7 +2,6 @@ package com.velocitypowered.api.event.connection; import com.google.common.base.Preconditions; import com.velocitypowered.api.event.ResultedEvent; -import com.velocitypowered.api.event.ResultedEvent.ComponentResult; import com.velocitypowered.api.proxy.InboundConnection; import net.kyori.text.Component; @@ -57,15 +56,14 @@ public class PreLoginEvent implements ResultedEvent { // Initiate a regular connection and move over to it.