diff --git a/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java b/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java index 53a7531cc..a4cdf9ef2 100644 --- a/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/proxy/ProxyPingEvent.java @@ -4,8 +4,6 @@ import com.google.common.base.Preconditions; import com.velocitypowered.api.proxy.InboundConnection; import com.velocitypowered.api.server.ServerPing; -import javax.annotation.Nonnull; - public class ProxyPingEvent { private final InboundConnection connection; private ServerPing ping; @@ -23,7 +21,7 @@ public class ProxyPingEvent { return ping; } - public void setPing(@Nonnull ServerPing ping) { + public void setPing(ServerPing ping) { this.ping = Preconditions.checkNotNull(ping, "ping"); } diff --git a/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java b/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java index 433c61097..6877c550d 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/ProxyServer.java @@ -8,7 +8,6 @@ import com.velocitypowered.api.proxy.messages.ChannelRegistrar; import com.velocitypowered.api.scheduler.Scheduler; import com.velocitypowered.api.server.ServerInfo; -import javax.annotation.Nonnull; import java.util.Collection; import java.util.Optional; import java.util.UUID; @@ -22,14 +21,14 @@ public interface ProxyServer { * @param username the username * @return an {@link Optional} with the player */ - Optional getPlayer(@Nonnull String username); + Optional getPlayer(String username); /** * Retrieves the player currently connected to this proxy by their Minecraft UUID. * @param uuid the UUID * @return an {@link Optional} with the player */ - Optional getPlayer(@Nonnull UUID uuid); + Optional getPlayer(UUID uuid); /** * Retrieves all players currently connected to this proxy. This call may or may not be a snapshot of all players @@ -49,7 +48,7 @@ public interface ProxyServer { * @param name the name of the server * @return the server */ - Optional getServerInfo(@Nonnull String name); + Optional getServerInfo(String name); /** * Retrieves all {@link ServerInfo}s registered with this proxy. @@ -61,13 +60,13 @@ public interface ProxyServer { * Registers a server with this proxy. A server with this name should not already exist. * @param server the server to register */ - void registerServer(@Nonnull ServerInfo server); + void registerServer(ServerInfo server); /** * Unregisters this server from the proxy. * @param server the server to unregister */ - void unregisterServer(@Nonnull ServerInfo server); + void unregisterServer(ServerInfo server); /** * Returns an instance of {@link CommandSource} that can be used to determine if the command is being invoked by diff --git a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java index 5a9702c5f..dff17b1df 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/VelocityServer.java @@ -39,7 +39,6 @@ import net.kyori.text.serializer.GsonComponentSerializer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import javax.annotation.Nonnull; import java.io.IOException; import java.nio.file.Files; import java.nio.file.NoSuchFileException; @@ -73,12 +72,12 @@ public class VelocityServer implements ProxyServer { private final Map connectionsByName = new ConcurrentHashMap<>(); private final CommandSource consoleCommandSource = new CommandSource() { @Override - public void sendMessage(@Nonnull Component component) { + public void sendMessage(Component component) { logger.info(ComponentSerializers.LEGACY.serialize(component)); } @Override - public boolean hasPermission(@Nonnull String permission) { + public boolean hasPermission(String permission) { return true; } }; @@ -246,13 +245,13 @@ public class VelocityServer implements ProxyServer { } @Override - public Optional getPlayer(@Nonnull String username) { + public Optional getPlayer(String username) { Preconditions.checkNotNull(username, "username"); return Optional.ofNullable(connectionsByName.get(username.toLowerCase(Locale.US))); } @Override - public Optional getPlayer(@Nonnull UUID uuid) { + public Optional getPlayer(UUID uuid) { Preconditions.checkNotNull(uuid, "uuid"); return Optional.ofNullable(connectionsByUuid.get(uuid)); } @@ -268,7 +267,7 @@ public class VelocityServer implements ProxyServer { } @Override - public Optional getServerInfo(@Nonnull String name) { + public Optional getServerInfo(String name) { Preconditions.checkNotNull(name, "name"); return servers.getServer(name); } @@ -279,12 +278,12 @@ public class VelocityServer implements ProxyServer { } @Override - public void registerServer(@Nonnull ServerInfo server) { + public void registerServer(ServerInfo server) { servers.register(server); } @Override - public void unregisterServer(@Nonnull ServerInfo server) { + public void unregisterServer(ServerInfo server) { servers.unregister(server); } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java index ee68dbb1d..1a16f34c0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/ServerCommand.java @@ -9,14 +9,13 @@ import com.velocitypowered.proxy.VelocityServer; import net.kyori.text.TextComponent; import net.kyori.text.format.TextColor; -import javax.annotation.Nonnull; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; public class ServerCommand implements Command { @Override - public void execute(@Nonnull CommandSource source, @Nonnull String[] args) { + public void execute(CommandSource source, String[] args) { if (!(source instanceof Player)) { source.sendMessage(TextComponent.of("Only players may run this command.", TextColor.RED)); return; @@ -42,7 +41,7 @@ public class ServerCommand implements Command { } @Override - public List suggest(@Nonnull CommandSource source, @Nonnull String[] currentArgs) { + public List suggest(CommandSource source, String[] currentArgs) { if (currentArgs.length == 0) { return VelocityServer.getServer().getAllServers().stream() .map(ServerInfo::getName) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/ShutdownCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/ShutdownCommand.java index 563ecd1fb..41eb3135a 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/ShutdownCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/ShutdownCommand.java @@ -6,11 +6,9 @@ import com.velocitypowered.proxy.VelocityServer; import net.kyori.text.TextComponent; import net.kyori.text.format.TextColor; -import javax.annotation.Nonnull; - public class ShutdownCommand implements Command { @Override - public void execute(@Nonnull CommandSource source, @Nonnull String[] args) { + public void execute(CommandSource source, String[] args) { if (source != VelocityServer.getServer().getConsoleCommandSource()) { source.sendMessage(TextComponent.of("You are not allowed to use this command.", TextColor.RED)); return; diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java index fd1ae6b13..94825af55 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommand.java @@ -7,11 +7,9 @@ import net.kyori.text.TextComponent; import net.kyori.text.event.ClickEvent; import net.kyori.text.format.TextColor; -import javax.annotation.Nonnull; - public class VelocityCommand implements Command { @Override - public void execute(@Nonnull CommandSource source, @Nonnull String[] args) { + public void execute(CommandSource source, String[] args) { String implVersion = VelocityServer.class.getPackage().getImplementationVersion(); TextComponent thisIsVelocity = TextComponent.builder() .content("This is ") diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 0d4beb4d4..e105451fb 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -33,7 +33,6 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.checkerframework.checker.nullness.qual.NonNull; -import javax.annotation.Nonnull; import java.net.InetSocketAddress; import java.util.List; import java.util.Optional; @@ -264,7 +263,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { } @Override - public boolean hasPermission(@Nonnull String permission) { + public boolean hasPermission(String permission) { return permissionFunction.getPermissionSetting(permission).asBoolean(); } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java index e1ed51ff8..dc26dec3e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/JavaPluginLoader.java @@ -11,7 +11,6 @@ import com.velocitypowered.proxy.plugin.loader.java.JavaVelocityPluginDescriptio import com.velocitypowered.proxy.plugin.loader.java.SerializedPluginDescription; import com.velocitypowered.proxy.plugin.loader.java.VelocityPluginModule; -import javax.annotation.Nonnull; import java.io.BufferedInputStream; import java.io.InputStreamReader; import java.io.Reader; @@ -34,7 +33,6 @@ public class JavaPluginLoader implements PluginLoader { this.baseDirectory = baseDirectory; } - @Nonnull @Override public PluginDescription loadPlugin(Path source) throws Exception { Optional serialized = getSerializedPluginInfo(source); @@ -60,7 +58,6 @@ public class JavaPluginLoader implements PluginLoader { return description; } - @Nonnull @Override public PluginContainer createPlugin(PluginDescription description) throws Exception { if (!(description instanceof JavaVelocityPluginDescription)) { diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/PluginLoader.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/PluginLoader.java index db2af2d1a..b16e58d0a 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/PluginLoader.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/loader/PluginLoader.java @@ -3,16 +3,13 @@ package com.velocitypowered.proxy.plugin.loader; import com.velocitypowered.api.plugin.PluginContainer; import com.velocitypowered.api.plugin.PluginDescription; -import javax.annotation.Nonnull; import java.nio.file.Path; /** * This interface is used for loading plugins. */ public interface PluginLoader { - @Nonnull PluginDescription loadPlugin(Path source) throws Exception; - @Nonnull PluginContainer createPlugin(PluginDescription plugin) throws Exception; }