3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Apply final modifier to all classes in the api module.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-09-29 03:38:42 -04:00
Ursprung 75c3bb5ee6
Commit 8be7ca9ab5
21 geänderte Dateien mit 32 neuen und 34 gelöschten Zeilen

Datei anzeigen

@ -7,7 +7,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* 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 Velocity.
*/ */
public class ConnectionHandshakeEvent { public final class ConnectionHandshakeEvent {
private final @NonNull InboundConnection connection; private final @NonNull InboundConnection connection;
public ConnectionHandshakeEvent(@NonNull InboundConnection connection) { public ConnectionHandshakeEvent(@NonNull InboundConnection connection) {

Datei anzeigen

@ -8,7 +8,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
* This event is fired when a player disconnects from the proxy. Operations on the provided player, aside from basic * This event is fired when a player disconnects from the proxy. Operations on the provided player, aside from basic
* data retrieval operations, may behave in undefined ways. * data retrieval operations, may behave in undefined ways.
*/ */
public class DisconnectEvent { public final class DisconnectEvent {
private @NonNull final Player player; private @NonNull final Player player;
public DisconnectEvent(@NonNull Player player) { public DisconnectEvent(@NonNull Player player) {

Datei anzeigen

@ -8,7 +8,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* This event is fired once the player has been authenticated but before they connect to a server on the proxy. * This event is fired once the player has been authenticated but before they connect to a server on the proxy.
*/ */
public class LoginEvent implements ResultedEvent<ResultedEvent.ComponentResult> { public final class LoginEvent implements ResultedEvent<ResultedEvent.ComponentResult> {
private final Player player; private final Player player;
private ComponentResult result; private ComponentResult result;

Datei anzeigen

@ -15,7 +15,7 @@ import java.util.Arrays;
* This event is fired when a plugin message is sent to the proxy, either from a client ({@link com.velocitypowered.api.proxy.Player}) * This event is fired when a plugin message is sent to the proxy, either from a client ({@link com.velocitypowered.api.proxy.Player})
* or a server ({@link com.velocitypowered.api.proxy.ServerConnection}). * or a server ({@link com.velocitypowered.api.proxy.ServerConnection}).
*/ */
public class PluginMessageEvent implements ResultedEvent<PluginMessageEvent.ForwardResult> { public final class PluginMessageEvent implements ResultedEvent<PluginMessageEvent.ForwardResult> {
private final ChannelMessageSource source; private final ChannelMessageSource source;
private final ChannelMessageSink target; private final ChannelMessageSink target;
private final ChannelIdentifier identifier; private final ChannelIdentifier identifier;
@ -74,7 +74,7 @@ public class PluginMessageEvent implements ResultedEvent<PluginMessageEvent.Forw
/** /**
* A result determining whether or not to forward this message on. * A result determining whether or not to forward this message on.
*/ */
public static class ForwardResult implements ResultedEvent.Result { public static final class ForwardResult implements ResultedEvent.Result {
private static final ForwardResult ALLOWED = new ForwardResult(true); private static final ForwardResult ALLOWED = new ForwardResult(true);
private static final ForwardResult DENIED = new ForwardResult(false); private static final ForwardResult DENIED = new ForwardResult(false);

Datei anzeigen

@ -7,7 +7,7 @@ import com.velocitypowered.api.proxy.Player;
* This event is fired once the player has been successfully authenticated and * This event is fired once the player has been successfully authenticated and
* fully initialized and player will be connected to server after this event * fully initialized and player will be connected to server after this event
*/ */
public class PostLoginEvent { public final class PostLoginEvent {
private final Player player; private final Player player;

Datei anzeigen

@ -14,7 +14,7 @@ import java.util.Optional;
* This event is fired when a player has initiated a connection with the proxy but before the proxy authenticates the * This event is fired when a player has initiated a connection with the proxy but before the proxy authenticates the
* player with Mojang or before the player's proxy connection is fully established (for offline mode). * player with Mojang or before the player's proxy connection is fully established (for offline mode).
*/ */
public class PreLoginEvent implements ResultedEvent<PreLoginEvent.PreLoginComponentResult> { public final class PreLoginEvent implements ResultedEvent<PreLoginEvent.PreLoginComponentResult> {
private final InboundConnection connection; private final InboundConnection connection;
private final String username; private final String username;
private PreLoginComponentResult result; private PreLoginComponentResult result;
@ -55,7 +55,7 @@ public class PreLoginEvent implements ResultedEvent<PreLoginEvent.PreLoginCompon
/** /**
* Represents an "allowed/allowed with forced online\offline mode/denied" result with a reason allowed for denial. * Represents an "allowed/allowed with forced online\offline mode/denied" result with a reason allowed for denial.
*/ */
public static class PreLoginComponentResult implements ResultedEvent.Result { public static final class PreLoginComponentResult implements ResultedEvent.Result {
private static final PreLoginComponentResult ALLOWED = new PreLoginComponentResult(Result.ALLOWED, null); private static final PreLoginComponentResult ALLOWED = new PreLoginComponentResult(Result.ALLOWED, null);
private static final PreLoginComponentResult FORCE_ONLINEMODE = new PreLoginComponentResult(Result.FORCE_ONLINE, null); private static final PreLoginComponentResult FORCE_ONLINEMODE = new PreLoginComponentResult(Result.FORCE_ONLINE, null);

Datei anzeigen

@ -12,7 +12,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* *
* <p>This event is only called once per subject, on initialisation.</p> * <p>This event is only called once per subject, on initialisation.</p>
*/ */
public class PermissionsSetupEvent { public final class PermissionsSetupEvent {
private final PermissionSubject subject; private final PermissionSubject subject;
private final PermissionProvider defaultProvider; private final PermissionProvider defaultProvider;
private PermissionProvider provider; private PermissionProvider provider;

Datei anzeigen

@ -9,7 +9,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
* This event is fired after the {@link com.velocitypowered.api.event.connection.PreLoginEvent} in order to set up the * This event is fired after the {@link com.velocitypowered.api.event.connection.PreLoginEvent} in 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. * game profile for the user. This can be used to configure a custom profile for a user, i.e. skin replacement.
*/ */
public class GameProfileRequestEvent { public final class GameProfileRequestEvent {
private final String username; private final String username;
private final InboundConnection connection; private final InboundConnection connection;
private final GameProfile originalProfile; private final GameProfile originalProfile;

Datei anzeigen

@ -11,7 +11,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
* Fired when a player is kicked from a server. You may either allow Velocity to kick the player (with an optional reason * Fired when a player is kicked from a server. You may either allow Velocity to kick the player (with an optional reason
* override) or redirect the player to a separate server. * override) or redirect the player to a separate server.
*/ */
public class KickedFromServerEvent implements ResultedEvent<KickedFromServerEvent.ServerKickResult> { public final class KickedFromServerEvent implements ResultedEvent<KickedFromServerEvent.ServerKickResult> {
private final Player player; private final Player player;
private final RegisteredServer server; private final RegisteredServer server;
private final Component originalReason; private final Component originalReason;
@ -60,7 +60,7 @@ public class KickedFromServerEvent implements ResultedEvent<KickedFromServerEven
/** /**
* Tells the proxy to disconnect the player with the specified reason. * Tells the proxy to disconnect the player with the specified reason.
*/ */
public static class DisconnectPlayer implements ServerKickResult { public static final class DisconnectPlayer implements ServerKickResult {
private final Component component; private final Component component;
private DisconnectPlayer(Component component) { private DisconnectPlayer(Component component) {
@ -90,7 +90,7 @@ public class KickedFromServerEvent implements ResultedEvent<KickedFromServerEven
* Tells the proxy to redirect the player to another server. No messages will be sent from the proxy * Tells the proxy to redirect the player to another server. No messages will be sent from the proxy
* when this result is used. * when this result is used.
*/ */
public static class RedirectPlayer implements ServerKickResult { public static final class RedirectPlayer implements ServerKickResult {
private final RegisteredServer server; private final RegisteredServer server;
private RedirectPlayer(RegisteredServer server) { private RedirectPlayer(RegisteredServer server) {

Datei anzeigen

@ -11,7 +11,7 @@ import java.util.Optional;
/** /**
* This event is fired once the player has been authenticated but before they connect to a server on the proxy. * This event is fired once the player has been authenticated but before they connect to a server on the proxy.
*/ */
public class PlayerChatEvent implements ResultedEvent<PlayerChatEvent.ChatResult> { public final class PlayerChatEvent implements ResultedEvent<PlayerChatEvent.ChatResult> {
private final Player player; private final Player player;
private final String message; private final String message;
private ChatResult result; private ChatResult result;
@ -52,7 +52,7 @@ public class PlayerChatEvent implements ResultedEvent<PlayerChatEvent.ChatResult
/** /**
* Represents the result of the {@link PlayerChatEvent}. * Represents the result of the {@link PlayerChatEvent}.
*/ */
public static class ChatResult implements ResultedEvent.Result { public static final class ChatResult implements ResultedEvent.Result {
private static final ChatResult ALLOWED = new ChatResult(true, null); private static final ChatResult ALLOWED = new ChatResult(true, null);
private static final ChatResult DENIED = new ChatResult(false, null); private static final ChatResult DENIED = new ChatResult(false, null);

Datei anzeigen

@ -4,7 +4,7 @@ import com.google.common.base.Preconditions;
import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.player.PlayerSettings; import com.velocitypowered.api.proxy.player.PlayerSettings;
public class PlayerSettingsChangedEvent { public final class PlayerSettingsChangedEvent {
private final Player player; private final Player player;
private final PlayerSettings playerSettings; private final PlayerSettings playerSettings;

Datei anzeigen

@ -8,7 +8,7 @@ import com.velocitypowered.api.proxy.server.RegisteredServer;
* This event is fired once the player has successfully connected to the target server and the connection to the previous * This event is fired once the player has successfully connected to the target server and the connection to the previous
* server has been de-established. * server has been de-established.
*/ */
public class ServerConnectedEvent { public final class ServerConnectedEvent {
private final Player player; private final Player player;
private final RegisteredServer server; private final RegisteredServer server;

Datei anzeigen

@ -12,7 +12,7 @@ import java.util.Optional;
/** /**
* This event is fired before the player connects to a server. * This event is fired before the player connects to a server.
*/ */
public class ServerPreConnectEvent implements ResultedEvent<ServerPreConnectEvent.ServerResult> { public final class ServerPreConnectEvent implements ResultedEvent<ServerPreConnectEvent.ServerResult> {
private final Player player; private final Player player;
private final RegisteredServer originalServer; private final RegisteredServer originalServer;
private ServerResult result; private ServerResult result;

Datei anzeigen

@ -3,7 +3,7 @@ package com.velocitypowered.api.event.proxy;
/** /**
* This event is fired by the proxy after plugins have been loaded but before the proxy starts accepting connections. * This event is fired by the proxy after plugins have been loaded but before the proxy starts accepting connections.
*/ */
public class ProxyInitializeEvent { public final class ProxyInitializeEvent {
@Override @Override
public String toString() { public String toString() {
return "ProxyInitializeEvent"; return "ProxyInitializeEvent";

Datei anzeigen

@ -7,7 +7,7 @@ import com.velocitypowered.api.proxy.server.ServerPing;
/** /**
* This event is fired when a server list ping request is sent by a remote client. * This event is fired when a server list ping request is sent by a remote client.
*/ */
public class ProxyPingEvent { public final class ProxyPingEvent {
private final InboundConnection connection; private final InboundConnection connection;
private ServerPing ping; private ServerPing ping;

Datei anzeigen

@ -4,7 +4,7 @@ package com.velocitypowered.api.event.proxy;
* This event is fired by the proxy after the proxy has stopped accepting connections but before the proxy process * This event is fired by the proxy after the proxy has stopped accepting connections but before the proxy process
* exits. * exits.
*/ */
public class ProxyShutdownEvent { public final class ProxyShutdownEvent {
@Override @Override
public String toString() { public String toString() {
return "ProxyShutdownEvent"; return "ProxyShutdownEvent";

Datei anzeigen

@ -1,8 +1,6 @@
package com.velocitypowered.api.proxy.player; package com.velocitypowered.api.proxy.player;
public class SkinParts { public final class SkinParts {
static final SkinParts SKIN_SHOW_ALL = new SkinParts((byte) 127);
private final byte bitmask; private final byte bitmask;
public SkinParts(byte skinBitmask) { public SkinParts(byte skinBitmask) {

Datei anzeigen

@ -11,7 +11,7 @@ import java.util.*;
/** /**
* Represents a 1.7 and above server list ping response. This class is immutable. * Represents a 1.7 and above server list ping response. This class is immutable.
*/ */
public class ServerPing { public final class ServerPing {
private final Version version; private final Version version;
private final Players players; private final Players players;
private final Component description; private final Component description;
@ -87,7 +87,7 @@ public class ServerPing {
/** /**
* A builder for {@link ServerPing} objects. * A builder for {@link ServerPing} objects.
*/ */
public static class Builder { public static final class Builder {
private Version version; private Version version;
private int onlinePlayers; private int onlinePlayers;
private int maximumPlayers; private int maximumPlayers;
@ -217,7 +217,7 @@ public class ServerPing {
} }
} }
public static class Version { public static final class Version {
private final int protocol; private final int protocol;
private final String name; private final String name;
@ -243,7 +243,7 @@ public class ServerPing {
} }
} }
public static class Players { public static final class Players {
private final int online; private final int online;
private final int max; private final int max;
private final List<SamplePlayer> sample; private final List<SamplePlayer> sample;
@ -276,7 +276,7 @@ public class ServerPing {
} }
} }
public static class SamplePlayer { public static final class SamplePlayer {
private final String name; private final String name;
private final UUID id; private final UUID id;
@ -302,7 +302,7 @@ public class ServerPing {
} }
} }
public static class ModInfo { public static final class ModInfo {
public static final ModInfo DEFAULT = new ModInfo("FML", ImmutableList.of()); public static final ModInfo DEFAULT = new ModInfo("FML", ImmutableList.of());
private final String type; private final String type;
@ -322,7 +322,7 @@ public class ServerPing {
} }
} }
public static class Mod { public static final class Mod {
private final String id; private final String id;
private final String version; private final String version;

Datei anzeigen

@ -10,7 +10,7 @@ import java.util.UUID;
/** /**
* Provides a small, useful selection of utilities for working with Minecraft UUIDs. * Provides a small, useful selection of utilities for working with Minecraft UUIDs.
*/ */
public class UuidUtils { public final class UuidUtils {
private UuidUtils() { private UuidUtils() {
throw new AssertionError(); throw new AssertionError();
} }

Datei anzeigen

@ -10,7 +10,7 @@ import java.util.Optional;
/** /**
* Represents a "full" title, including all components. This class is immutable. * Represents a "full" title, including all components. This class is immutable.
*/ */
public class TextTitle implements Title { public final class TextTitle implements Title {
private final Component title; private final Component title;
private final Component subtitle; private final Component subtitle;
private final int stay; private final int stay;

Datei anzeigen

@ -3,7 +3,7 @@ package com.velocitypowered.api.util.title;
/** /**
* Provides special-purpose titles. * Provides special-purpose titles.
*/ */
public class Titles { public final class Titles {
private Titles() { private Titles() {
throw new AssertionError(); throw new AssertionError();
} }