From 4308eda6fd4ce3d637ad29b50f53d870ec1facbc Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 3 Aug 2019 15:48:34 +0100 Subject: more cleanup work, fix build --- spark-common/src/main/java/me/lucko/spark/common/SparkPlugin.java | 4 ++-- .../java/me/lucko/spark/common/command/CommandResponseHandler.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'spark-common/src/main') 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 getSendersWithPermission(String permission); + Stream 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 action) { - Set senders = this.platform.getPlugin().getSendersWithPermission("spark"); + Set senders = this.platform.getPlugin().getSendersWithPermission("spark").collect(Collectors.toSet()); senders.add(this.sender); senders.forEach(action); } -- cgit