Bump com.puppycrawl.tools:checkstyle to 14.1.0 and fix warnings that were false-negatives before [ci skip]

Checkstyle fixed a bunch of false-negatives; linting errors in the source that should've been caught according to our settings. Rather than updating `checkstyle.xml` to work around these, this commit also properly fixes these checkstyle errors.
This commit is contained in:
Wouter Gritter
2026-09-13 14:01:39 +02:00
parent 15b6ddd1bf
commit bc55300123
20 changed files with 66 additions and 50 deletions
@@ -73,6 +73,7 @@ public final class PreLoginEvent implements ResultedEvent<PreLoginEvent.PreLogin
/**
* 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>
*
@@ -40,9 +40,9 @@ public final class PlayerClientBrandEvent {
@Override
public String toString() {
return "PlayerClientBrandEvent{"
+ "player=" + player
+ ", brand='" + brand + '\''
+ '}';
+ "player=" + player
+ ", brand='" + brand + '\''
+ '}';
}
}
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
/**
* 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.
@@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
/**
* 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,
* Velocity will only wait for a maximum of 5 seconds.</p>
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
/**
* 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>
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
/**
* 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,
* Velocity will only wait for a maximum of 5 seconds. If you need to hold a player in configuration
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
/**
* 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>
*
@@ -16,6 +16,7 @@ package com.velocitypowered.api.network;
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},
@@ -24,6 +25,7 @@ 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>
@@ -31,11 +33,13 @@ public enum ProtocolState {
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
@@ -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>
*/
@@ -15,7 +15,6 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* 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>
@@ -244,7 +244,7 @@ public interface Player extends
* 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>
@@ -260,7 +260,7 @@ public interface Player extends
* 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>
@@ -315,6 +315,7 @@ public interface Player extends
/**
* {@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>
@@ -400,7 +401,7 @@ public interface Player extends
* 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) {
@@ -413,7 +414,7 @@ public interface Player extends
* 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) {
@@ -456,7 +457,7 @@ public interface Player extends
* 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) {
@@ -469,7 +470,7 @@ public interface Player extends
* 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) {
@@ -482,7 +483,7 @@ public interface Player extends
* 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() {
@@ -56,6 +56,7 @@ public interface KeySigned {
* 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.
*
@@ -237,8 +237,11 @@ public interface TabListEntry extends KeyIdentifiable {
/**
* 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