Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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}/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface CommandSource extends Audience, PermissionSubject {
* @param message MiniMessage content
* @see <a href="https://docs.papermc.io/adventure/minimessage/format/">MiniMessage docs</a>
* for more information on the format.
**/
*/
default void sendRichMessage(final @NotNull String message) {
this.sendMessage(MiniMessage.miniMessage().deserialize(message, this));
}
Expand All @@ -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));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public interface Continuation {
* Resumes the continuation after the executed task failed.
*/
void resumeWithException(Throwable exception);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>
* 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.
* </p>
* <p>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.</p>
*/
@AwaitingEvent
public final class PreLoginEvent implements ResultedEvent<PreLoginEvent.PreLoginComponentResult> {
Expand Down Expand Up @@ -73,6 +71,7 @@ public String getUsername() {

/**
* Returns the UUID of the connecting player.
*
* <p>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.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
* <p>
* 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.
* </p>
* <p>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.</p>
*/
@AwaitingEvent
public final class GameProfileRequestEvent {
Expand Down Expand Up @@ -92,5 +90,4 @@ public String toString() {
+ "}";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public String getBrand() {
@Override
public String toString() {
return "PlayerClientBrandEvent{"
+ "player=" + player
+ ", brand='" + brand + '\''
+ '}';
+ "player=" + player
+ ", brand='" + brand + '\''
+ '}';
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* This event is executed when a player entered the configuration state and can be configured by Velocity.
*
* <p>Velocity will wait for this event before continuing/ending the configuration state.</p>
*
* @param player The player who can be configured.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
/**
* This event is executed when a player is about to enter the configuration state.
* It is <b>not</b> called for the initial configuration of a player after login.
*
* <p>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.</p>
*
* @param player The player who is about to enter configuration state.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* This event is executed when a player has entered the configuration state.
*
* <p>From this moment on, until the {@link PlayerFinishedConfigurationEvent} is executed,
* the {@linkplain Player#getProtocolState()} method is guaranteed
* to return {@link ProtocolState#CONFIGURATION}.</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

/**
* This event is executed when a player is about to finish the configuration state.
*
* <p>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}.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

/**
* This event is executed when a player has finished the configuration state.
*
* <p>From this moment on, the {@link Player#getProtocolState()} method
* will return {@link ProtocolState#PLAY}.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
public enum ProtocolState {
/**
* Initial connection State.
*
* <p>This status can be caused by a {@link HandshakeIntent#STATUS},
* {@link HandshakeIntent#LOGIN} or {@link HandshakeIntent#TRANSFER} intent.</p>
* If the intent is LOGIN or TRANSFER, the next state will be {@link #LOGIN},
Expand All @@ -24,18 +25,21 @@ public enum ProtocolState {
HANDSHAKE,
/**
* Ping State of a connection.
*
* <p>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.</p>
*/
STATUS,
/**
* Authentication State of a connection.
*
* <p>At this moment the player is authenticating with the authentication servers.</p>
*/
LOGIN,
/**
* Configuration State of a connection.
*
* <p>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
Expand All @@ -46,6 +50,7 @@ public enum ProtocolState {
CONFIGURATION,
/**
* Game State of a connection.
*
* <p>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.</p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* Represents three different states of a setting.
*
* <p>Possible values:</p>
* <p></p>
*
* <ul>
* <li>{@link #TRUE} - a positive setting</li>
* <li>{@link #FALSE} - a negative (negated) setting</li>
Expand Down Expand Up @@ -81,7 +81,6 @@ public static Tristate fromOptionalBoolean(Optional<Boolean> val) {
return val.map(Tristate::fromBoolean).orElse(UNDEFINED);
}


private final boolean booleanValue;

Tristate(boolean booleanValue) {
Expand Down
17 changes: 9 additions & 8 deletions api/src/main/java/com/velocitypowered/api/proxy/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ default void clearHeaderAndFooter() {
* Gets the {@link ResourcePackInfo} of the currently applied
* resource-pack or null if none.
*
* <p> Note that since 1.20.3 it is no longer recommended to use
* <p>Note that since 1.20.3 it is no longer recommended to use
* this method as it will only return the last applied
* resource pack. To get all applied resource packs, use
* {@link #getAppliedResourcePacks()} instead. </p>
Expand All @@ -260,7 +260,7 @@ default void clearHeaderAndFooter() {
* the user is currently downloading or is currently
* prompted to install or null if none.
*
* <p> Note that since 1.20.3 it is no longer recommended to use
* <p>Note that since 1.20.3 it is no longer recommended to use
* this method as it will only return the last pending
* resource pack. To get all pending resource packs, use
* {@link #getPendingResourcePacks()} instead. </p>
Expand Down Expand Up @@ -315,6 +315,7 @@ default void clearHeaderAndFooter() {

/**
* {@inheritDoc}
*
* <p><strong>Note that this method does not send a plugin message to the server the player
* is connected to.</strong> You should only use this method if you are trying to communicate
* with a mod that is installed on the player's client.</p>
Expand Down Expand Up @@ -400,7 +401,7 @@ default void applySkinToPlayerHeadContents(
* and will not perform any actions.</b>
* @see #playSound(Sound, Sound.Emitter)
* @see <a href="https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported">
* Unsupported Adventure Operations</a>
* Unsupported Adventure Operations</a>
*/
@Override
default void playSound(@NotNull Sound sound) {
Expand All @@ -413,7 +414,7 @@ default void playSound(@NotNull Sound sound) {
* and will not perform any actions.</b>
* @see #playSound(Sound, Sound.Emitter)
* @see <a href="https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported">
* Unsupported Adventure Operations</a>
* Unsupported Adventure Operations</a>
*/
@Override
default void playSound(@NotNull Sound sound, double x, double y, double z) {
Expand Down Expand Up @@ -456,7 +457,7 @@ default void stopSound(@NotNull SoundStop stop) {
* and will not perform any actions.</b>
*
* @see <a href="https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported">
* Unsupported Adventure Operations</a>
* Unsupported Adventure Operations</a>
*/
@Override
default void openBook(@NotNull Book book) {
Expand All @@ -469,7 +470,7 @@ default void openBook(@NotNull Book book) {
* and will not perform any actions.</b>
*
* @see <a href="https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported">
* Unsupported Adventure Operations</a>
* Unsupported Adventure Operations</a>
*/
@Override
default void showDialog(@NotNull DialogLike dialog) {
Expand All @@ -482,7 +483,7 @@ default void showDialog(@NotNull DialogLike dialog) {
* and will not perform any actions.</b>
*
* @see <a href="https://docs.papermc.io/velocity/dev/pitfalls/#audience-operations-are-not-fully-supported">
* Unsupported Adventure Operations</a>
* Unsupported Adventure Operations</a>
*/
@Override
default void closeDialog() {
Expand Down Expand Up @@ -532,4 +533,4 @@ default void closeDialog() {
* @sinceMinecraft 1.21
*/
void setServerLinks(@NotNull List<ServerLink> links);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public interface IdentifiedKey extends KeySigned {
*/
PublicKey getSignedPublicKey();


/**
* Validates a signature against this public key.
*
Expand Down Expand Up @@ -69,11 +68,11 @@ enum Revision implements Ordered<Revision> {
this.backwardsCompatibleTo = backwardsCompatibleTo;
this.applicableTo = applicableTo;
}

public Set<Revision> getBackwardsCompatibleTo() {
return backwardsCompatibleTo;
}

public Set<ProtocolVersion> getApplicableTo() {
return applicableTo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public interface KeySigned {
*/
Instant getExpiryTemporal();


/**
* Check if the signature has expired.
*
Expand All @@ -56,6 +55,7 @@ default boolean hasExpired() {
* Validates the signature, expiry temporal and key against the
* signer public key. Note: This will **not** check for
* expiry. You can check for expiry with {@link KeySigned#hasExpired()}.
*
* <p>DOES NOT WORK YET FOR MESSAGES AND COMMANDS!</p>
* Addendum: Does not work for 1.19.1 until the user has authenticated.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface ChannelMessageSink {
* @param data the data to send
* @return whether or not the message could be sent
*/
boolean sendPluginMessage(@NotNull ChannelIdentifier identifier, byte @NotNull[] data);
boolean sendPluginMessage(@NotNull ChannelIdentifier identifier, byte @NotNull [] data);

/**
* Sends a plugin message to this target.
Expand All @@ -41,7 +41,6 @@ public interface ChannelMessageSink {
* @return whether the message could be sent
*/
@ApiStatus.Experimental
boolean sendPluginMessage(
@NotNull ChannelIdentifier identifier,
@NotNull PluginMessageEncoder dataEncoder);
boolean sendPluginMessage(@NotNull ChannelIdentifier identifier,
@NotNull PluginMessageEncoder dataEncoder);
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ public interface ResourcePackInfo extends ResourcePackRequestLike {

/**
* Returns a copy of this {@link ResourcePackInfo} instance as a builder, using the new URL.
* <p/>
* It is <b>not</b> guaranteed that
*
* <p>It is <b>not</b> guaranteed that
* {@code resourcePackInfo.asBuilder(resourcePackInfo.getUrl()).build().equals(resourcePackInfo)}
* is true, because the {@link ResourcePackInfo#getOrigin()} and
* {@link ResourcePackInfo#getOriginalOrigin()} fields are transient.
* {@link ResourcePackInfo#getOriginalOrigin()} fields are transient.</p>
*
* @param newUrl The new URL to use in the updated builder.
*
Expand Down Expand Up @@ -174,4 +174,4 @@ enum Origin {
*/
PLUGIN_ON_PROXY
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,11 @@ public Builder profile(GameProfile profile) {

/**
* Sets the {@link IdentifiedKey} of the {@link TabListEntry}.
*
* <p>This only works for players currently <b>not</b> connected to this proxy.</p>
*
* <p>For any player currently connected to this proxy this will be filled automatically.</p>
*
* <p>Will ignore mismatching key revisions data.</p>
*
* @param chatSession session to set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ public Collection<PluginInformation> getPlugins() {
return plugins;
}


/**
* Creates a new {@link Builder} instance from data represented by this response, so that you
* may create a new {@link QueryResponse} with new data. It is guaranteed that
Expand Down
Loading