diff options
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); } |