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 --- .../java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java | 2 +- .../java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'spark-fabric/src') diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java index 1bc6707..ae8f3e0 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricClientSparkPlugin.java @@ -139,7 +139,7 @@ public class FabricClientSparkPlugin extends FabricSparkPlugin implements Sugges } @Override - public Stream getSendersWithPermission(String permission) { + public Stream getCommandSenders() { return Stream.of(new FabricCommandSender(this.minecraft.player, this)); } diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java index 08edc82..9244b57 100644 --- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java +++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java @@ -120,10 +120,9 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman } @Override - public Stream getSendersWithPermission(String permission) { + public Stream getCommandSenders() { return Stream.concat( - this.server.getPlayerManager().getPlayerList().stream() - .filter(player -> hasPermission(player, permission)), + this.server.getPlayerManager().getPlayerList().stream(), Stream.of(this.server) ).map(sender -> new FabricCommandSender(sender, this)); } -- cgit