diff options
author | lucko (Luck) <git@lucko.me> | 2020-12-31 00:11:51 +0000 |
---|---|---|
committer | lucko (Luck) <git@lucko.me> | 2020-12-31 00:11:51 +0000 |
commit | 28cf46ec3e09e5e4b4a57c5eacb84787989020ce (patch) | |
tree | 316c451f9d7f45fe9af8227f5a19cdcae52ab238 /spark-velocity/src/main/java/me/lucko | |
parent | 737c09973ab6a45cbaa5bdbad24632b0fb23ce07 (diff) | |
download | spark-28cf46ec3e09e5e4b4a57c5eacb84787989020ce.tar.gz spark-28cf46ec3e09e5e4b4a57c5eacb84787989020ce.tar.bz2 spark-28cf46ec3e09e5e4b4a57c5eacb84787989020ce.zip |
Fix some deprecation warnings
Diffstat (limited to 'spark-velocity/src/main/java/me/lucko')
-rw-r--r-- | spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java index 798f4f1..b9e492b 100644 --- a/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java +++ b/spark-velocity/src/main/java/me/lucko/spark/velocity/VelocitySparkPlugin.java @@ -23,6 +23,7 @@ package me.lucko.spark.velocity; import com.google.inject.Inject; import com.velocitypowered.api.command.Command; import com.velocitypowered.api.command.CommandSource; +import com.velocitypowered.api.command.SimpleCommand; import com.velocitypowered.api.event.PostOrder; import com.velocitypowered.api.event.Subscribe; import com.velocitypowered.api.event.proxy.ProxyInitializeEvent; @@ -37,6 +38,7 @@ import org.checkerframework.checker.optional.qual.MaybePresent; import java.nio.file.Path; import java.util.List; +import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; @Plugin( @@ -46,7 +48,7 @@ import java.util.stream.Stream; description = "@desc@", authors = {"Luck", "sk89q"} ) -public class VelocitySparkPlugin implements SparkPlugin, Command { +public class VelocitySparkPlugin implements SparkPlugin, SimpleCommand { private final ProxyServer proxy; private final Path configDirectory; @@ -63,7 +65,7 @@ public class VelocitySparkPlugin implements SparkPlugin, Command { public void onEnable(ProxyInitializeEvent e) { this.platform = new SparkPlatform(this); this.platform.enable(); - this.proxy.getCommandManager().register(this, "sparkv", "sparkvelocity"); + this.proxy.getCommandManager().register("sparkv", this, "sparkvelocity"); } @Subscribe(order = PostOrder.LAST) @@ -72,13 +74,13 @@ public class VelocitySparkPlugin implements SparkPlugin, Command { } @Override - public void execute(CommandSource sender, String[] args) { - this.platform.executeCommand(new VelocityCommandSender(sender), args); + public void execute(Invocation inv) { + this.platform.executeCommand(new VelocityCommandSender(inv.source()), inv.arguments()); } @Override - public @MaybePresent List<String> suggest(CommandSource sender, String[] currentArgs) { - return this.platform.tabCompleteCommand(new VelocityCommandSender(sender), currentArgs); + public List<String> suggest(Invocation inv) { + return this.platform.tabCompleteCommand(new VelocityCommandSender(inv.source()), inv.arguments()); } @Override |