diff options
author | Luck <git@lucko.me> | 2019-08-03 15:48:34 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-08-03 15:48:34 +0100 |
commit | 4308eda6fd4ce3d637ad29b50f53d870ec1facbc (patch) | |
tree | 893f48b04d89ada7ed3f7e436a28ad538c49fe41 /spark-common/src/main | |
parent | 9d5aad9413ec8a219549f626db6e33ccca2f5acf (diff) | |
download | spark-4308eda6fd4ce3d637ad29b50f53d870ec1facbc.tar.gz spark-4308eda6fd4ce3d637ad29b50f53d870ec1facbc.tar.bz2 spark-4308eda6fd4ce3d637ad29b50f53d870ec1facbc.zip |
more cleanup work, fix build
Diffstat (limited to 'spark-common/src/main')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java | 4 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java b/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java index 2b48ca7..72bbfbc 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java +++ b/spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java @@ -24,7 +24,7 @@ import me.lucko.spark.common.sampler.ThreadDumper; import me.lucko.spark.common.sampler.TickCounter; import java.nio.file.Path; -import java.util.Set; +import java.util.stream.Stream; public interface SparkPlugin { @@ -34,7 +34,7 @@ public interface SparkPlugin { String getLabel(); - Set<? extends CommandSender> getSendersWithPermission(String permission); + Stream<? extends CommandSender> getSendersWithPermission(String permission); void runAsync(Runnable r); diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java b/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java index 88a597d..6f02180 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java +++ b/spark-common/src/main/java/me/lucko/spark/common/command/CommandResponseHandler.java @@ -29,6 +29,7 @@ import net.kyori.text.format.TextDecoration; import java.util.Set; import java.util.function.Consumer; +import java.util.stream.Collectors; public class CommandResponseHandler { @@ -53,7 +54,7 @@ public class CommandResponseHandler { } public void allSenders(Consumer<? super CommandSender> action) { - Set<CommandSender> senders = this.platform.getPlugin().getSendersWithPermission("spark"); + Set<CommandSender> senders = this.platform.getPlugin().getSendersWithPermission("spark").collect(Collectors.toSet()); senders.add(this.sender); senders.forEach(action); } |