diff options
author | Luck <git@lucko.me> | 2021-03-11 13:04:09 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2021-03-11 13:04:09 +0000 |
commit | 1abff42884564d85c0895461b7e60aa9dbbd28d0 (patch) | |
tree | d9d6ce721b33214b1abff4425984ccee8b690607 /spark-sponge/src/main/java/me/lucko/spark/sponge | |
parent | 4e765fe0c4b746c3527e670ce9ebaaf553bd8479 (diff) | |
download | spark-1abff42884564d85c0895461b7e60aa9dbbd28d0.tar.gz spark-1abff42884564d85c0895461b7e60aa9dbbd28d0.tar.bz2 spark-1abff42884564d85c0895461b7e60aa9dbbd28d0.zip |
Fix command broadcast permission checks, other misc tidying
Diffstat (limited to 'spark-sponge/src/main/java/me/lucko/spark/sponge')
-rw-r--r-- | spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java | 6 |
1 files changed, 3 insertions, 3 deletions
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<SpongeCommandSender> getSendersWithPermission(String permission) { + public Stream<SpongeCommandSender> 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 |