diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 268a8197ba..aeda343341 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -66,7 +66,7 @@ tasks { "https://www.javadocs.dev/org.slf4j/slf4j-api/${libs.slf4j.get().version}/", "https://guava.dev/releases/${libs.guava.get().version}/api/docs/", "https://google.github.io/guice/api-docs/${libs.guice.get().version}/javadoc/", - "https://docs.oracle.com/en/java/javase/17/docs/api/", + "https://docs.oracle.com/en/java/javase/21/docs/api/", "https://jd.advntr.dev/api/${libs.adventure.bom.get().version}/", "https://jd.advntr.dev/text-minimessage/${libs.adventure.bom.get().version}/", "https://jd.advntr.dev/key/${libs.adventure.bom.get().version}/", diff --git a/api/src/main/java/com/velocitypowered/api/command/CommandSource.java b/api/src/main/java/com/velocitypowered/api/command/CommandSource.java index c94dec4c67..067b908f45 100644 --- a/api/src/main/java/com/velocitypowered/api/command/CommandSource.java +++ b/api/src/main/java/com/velocitypowered/api/command/CommandSource.java @@ -25,7 +25,7 @@ public interface CommandSource extends Audience, PermissionSubject { * @param message MiniMessage content * @see MiniMessage docs * for more information on the format. - **/ + */ default void sendRichMessage(final @NotNull String message) { this.sendMessage(MiniMessage.miniMessage().deserialize(message, this)); } @@ -41,19 +41,19 @@ default void sendRichMessage(final @NotNull String message) { */ default void sendRichMessage( final @NotNull String message, - final @NotNull TagResolver @NotNull... resolvers + final @NotNull TagResolver @NotNull ... resolvers ) { this.sendMessage(MiniMessage.miniMessage().deserialize(message, this, resolvers)); } /** - * Sends a plain message to this source. - * - * @param message plain message - * @apiNote This method will not apply any form of parse to the text provided, - * however, it is recommended not to use legacy color codes as this is a deprecated format + * Sends a plain message to this source. + * + * @param message plain message + * @apiNote This method will not apply any form of parse to the text provided, + * however, it is recommended not to use legacy color codes as this is a deprecated format * and not recommended. - */ + */ default void sendPlainMessage(final @NotNull String message) { this.sendMessage(Component.text(message)); } diff --git a/api/src/main/java/com/velocitypowered/api/event/Continuation.java b/api/src/main/java/com/velocitypowered/api/event/Continuation.java index 30672ef606..11ab424aef 100644 --- a/api/src/main/java/com/velocitypowered/api/event/Continuation.java +++ b/api/src/main/java/com/velocitypowered/api/event/Continuation.java @@ -22,4 +22,4 @@ public interface Continuation { * Resumes the continuation after the executed task failed. */ void resumeWithException(Throwable exception); -} \ No newline at end of file +} 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 952cb091b7..3a7025757e 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 @@ -23,11 +23,9 @@ * with the login process, but you should try to limit the work done in any event that fires during * the login process. * - *

- * As of Velocity 3.1.0, you may cast the {@link InboundConnection} to a - * {@link com.velocitypowered.api.proxy.LoginPhaseConnection} to allow a - * proxy plugin to send login plugin messages to the client. - *

+ *

As of Velocity 3.1.0, you may cast the {@link InboundConnection} to a + * {@link com.velocitypowered.api.proxy.LoginPhaseConnection} to allow a + * proxy plugin to send login plugin messages to the client.

*/ @AwaitingEvent public final class PreLoginEvent implements ResultedEvent { @@ -73,6 +71,7 @@ public String getUsername() { /** * Returns the UUID of the connecting player. + * *

This value is {@code null} on 1.19.2 and lower, * up to 1.20.1 it is optional and from 1.20.2 it will always be available.

* diff --git a/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java index bb682255d7..a55dc12aec 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/GameProfileRequestEvent.java @@ -18,11 +18,9 @@ * order to set up the game profile for the user. This can be used to configure a custom profile for * a user, i.e. skin replacement. * - *

- * Velocity will wait for this event to finish firing before proceeding with the rest of the login - * process, but you should try to limit the work done in any event that fires during the login - * process. - *

+ *

Velocity will wait for this event to finish firing before proceeding with the rest of the login + * process, but you should try to limit the work done in any event that fires during the login + * process.

*/ @AwaitingEvent public final class GameProfileRequestEvent { @@ -92,5 +90,4 @@ public String toString() { + "}"; } - } diff --git a/api/src/main/java/com/velocitypowered/api/event/player/PlayerClientBrandEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/PlayerClientBrandEvent.java index 268d5b6a19..2a671ac6d2 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/PlayerClientBrandEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/PlayerClientBrandEvent.java @@ -40,9 +40,9 @@ public String getBrand() { @Override public String toString() { return "PlayerClientBrandEvent{" - + "player=" + player - + ", brand='" + brand + '\'' - + '}'; + + "player=" + player + + ", brand='" + brand + '\'' + + '}'; } } diff --git a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerConfigurationEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerConfigurationEvent.java index 6e042af1c7..60b172f6c5 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerConfigurationEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerConfigurationEvent.java @@ -14,6 +14,7 @@ /** * This event is executed when a player entered the configuration state and can be configured by Velocity. + * *

Velocity will wait for this event before continuing/ending the configuration state.

* * @param player The player who can be configured. diff --git a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnterConfigurationEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnterConfigurationEvent.java index 05d6c2af02..97a2ded0e0 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnterConfigurationEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnterConfigurationEvent.java @@ -15,8 +15,9 @@ /** * This event is executed when a player is about to enter the configuration state. * It is not called for the initial configuration of a player after login. + * *

Velocity will wait for this event before asking the client to enter configuration state. - * However due to backend server being unable to keep the connection alive during state changes, + * However, due to backend server being unable to keep the connection alive during state changes, * Velocity will only wait for a maximum of 5 seconds.

* * @param player The player who is about to enter configuration state. diff --git a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnteredConfigurationEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnteredConfigurationEvent.java index c16777066c..6560f7bc43 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnteredConfigurationEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerEnteredConfigurationEvent.java @@ -14,6 +14,7 @@ /** * This event is executed when a player has entered the configuration state. + * *

From this moment on, until the {@link PlayerFinishedConfigurationEvent} is executed, * the {@linkplain Player#getProtocolState()} method is guaranteed * to return {@link ProtocolState#CONFIGURATION}.

diff --git a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishConfigurationEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishConfigurationEvent.java index 50df5a8abe..1cd3f2833c 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishConfigurationEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishConfigurationEvent.java @@ -14,8 +14,9 @@ /** * This event is executed when a player is about to finish the configuration state. + * *

Velocity will wait for this event before asking the client to finish the configuration state. - * However due to backend server being unable to keep the connection alive during state changes, + * However, due to backend server being unable to keep the connection alive during state changes, * Velocity will only wait for a maximum of 5 seconds. If you need to hold a player in configuration * state, use the {@link PlayerConfigurationEvent}.

* diff --git a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishedConfigurationEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishedConfigurationEvent.java index 517f119cfe..994a1d4111 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishedConfigurationEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/configuration/PlayerFinishedConfigurationEvent.java @@ -14,6 +14,7 @@ /** * This event is executed when a player has finished the configuration state. + * *

From this moment on, the {@link Player#getProtocolState()} method * will return {@link ProtocolState#PLAY}.

* diff --git a/api/src/main/java/com/velocitypowered/api/network/ProtocolState.java b/api/src/main/java/com/velocitypowered/api/network/ProtocolState.java index 0ecc8287a6..cd9b04d559 100644 --- a/api/src/main/java/com/velocitypowered/api/network/ProtocolState.java +++ b/api/src/main/java/com/velocitypowered/api/network/ProtocolState.java @@ -16,6 +16,7 @@ public enum ProtocolState { /** * Initial connection State. + * *

This status can be caused by a {@link HandshakeIntent#STATUS}, * {@link HandshakeIntent#LOGIN} or {@link HandshakeIntent#TRANSFER} intent.

* If the intent is LOGIN or TRANSFER, the next state will be {@link #LOGIN}, @@ -24,6 +25,7 @@ public enum ProtocolState { HANDSHAKE, /** * Ping State of a connection. + * *

Connections with the {@link HandshakeIntent#STATUS} intent will pass through this state * and be disconnected after it requests the ping from the server * and the server responds with the respective ping.

@@ -31,11 +33,13 @@ public enum ProtocolState { STATUS, /** * Authentication State of a connection. + * *

At this moment the player is authenticating with the authentication servers.

*/ LOGIN, /** * Configuration State of a connection. + * *

At this point the player allows the server to send information * such as resource packs and plugin messages, at the same time the player * will send his client brand and the respective plugin messages @@ -46,6 +50,7 @@ public enum ProtocolState { CONFIGURATION, /** * Game State of a connection. + * *

In this state is where the whole game runs, the server is able to change * the player's state to {@link #CONFIGURATION} as needed in versions 1.20.2 and higher.

*/ diff --git a/api/src/main/java/com/velocitypowered/api/permission/Tristate.java b/api/src/main/java/com/velocitypowered/api/permission/Tristate.java index ddbe26a866..003759e82b 100644 --- a/api/src/main/java/com/velocitypowered/api/permission/Tristate.java +++ b/api/src/main/java/com/velocitypowered/api/permission/Tristate.java @@ -15,7 +15,7 @@ * Represents three different states of a setting. * *

Possible values:

- *

+ * *