Mix of Checkstyle and SonarLint.

This commit is contained in:
Andrew Steinborn
2018-10-28 03:18:15 -04:00
parent 9806d57a13
commit 1310cd2c53
15 changed files with 98 additions and 53 deletions

View File

@@ -4,7 +4,7 @@ import com.google.common.base.Preconditions;
import com.velocitypowered.api.proxy.InboundConnection;
/**
* This event is fired when a handshake is established between a client and Velocity.
* This event is fired when a handshake is established between a client and the proxy.
*/
public final class ConnectionHandshakeEvent {

View File

@@ -14,7 +14,8 @@ public @interface Plugin {
/**
* The ID of the plugin. This ID should be unique as to not conflict with other plugins. The
* plugin ID must match the {@link PluginDescription#ID_PATTERN}.
* plugin ID may contain alphanumeric characters, dashes, and underscores, and be a maximum
* of 64 characters long.
*
* @return the ID for this plugin
*/

View File

@@ -186,21 +186,23 @@ public final class TextTitle implements Title {
return this;
}
public Builder stay(int ticks) {
private int checkTicks(int ticks) {
Preconditions.checkArgument(ticks >= 0, "ticks value %s is negative", ticks);
this.stay = ticks;
return ticks;
}
public Builder stay(int ticks) {
this.stay = checkTicks(ticks);
return this;
}
public Builder fadeIn(int ticks) {
Preconditions.checkArgument(ticks >= 0, "ticks value %s is negative", ticks);
this.fadeIn = ticks;
this.fadeIn = checkTicks(ticks);
return this;
}
public Builder fadeOut(int ticks) {
Preconditions.checkArgument(ticks >= 0, "ticks value %s is negative", ticks);
this.fadeOut = ticks;
this.fadeOut = checkTicks(ticks);
return this;
}