From 1abff42884564d85c0895461b7e60aa9dbbd28d0 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 11 Mar 2021 13:04:09 +0000 Subject: Fix command broadcast permission checks, other misc tidying --- .../src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'spark-sponge/src/main/java/me/lucko/spark/sponge') diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java index 055f1f4..38af806 100644 --- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java +++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java @@ -109,9 +109,9 @@ public class SpongeSparkPlugin implements SparkPlugin { } @Override - public Stream getSendersWithPermission(String permission) { + public Stream getCommandSenders() { return Stream.concat( - this.game.getServer().getOnlinePlayers().stream().filter(player -> player.hasPermission(permission)), + this.game.getServer().getOnlinePlayers().stream(), Stream.of(this.game.getServer().getConsole()) ).map(source -> new SpongeCommandSender(source, this.audienceFactory)); } @@ -156,7 +156,7 @@ public class SpongeSparkPlugin implements SparkPlugin { @Override public boolean testPermission(CommandSource source) { - return source.hasPermission("spark"); + return this.plugin.platform.hasPermissionForAnyCommand(new SpongeCommandSender(source, this.plugin.audienceFactory)); } @Override -- cgit