diff options
author | Luck <git@lucko.me> | 2019-04-17 10:06:47 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-04-17 10:06:47 +0100 |
commit | 88857e015d3be6f894592204d76d8580eae0ac9b (patch) | |
tree | 60b87660120586542877bc4343a84f571ee2aae1 /spark-forge/src/main | |
parent | e7b1797731508202c62dfa5bdc1c4d779f5cbfd1 (diff) | |
download | spark-88857e015d3be6f894592204d76d8580eae0ac9b.tar.gz spark-88857e015d3be6f894592204d76d8580eae0ac9b.tar.bz2 spark-88857e015d3be6f894592204d76d8580eae0ac9b.zip |
Fix permission checking
Diffstat (limited to 'spark-forge/src/main')
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java | 2 | ||||
-rw-r--r-- | spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java index 2c6c2fb..b214308 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeClientSparkPlugin.java @@ -43,7 +43,7 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin { } @Override - public Set<ICommandSender> getSenders() { + public Set<ICommandSender> getSendersWithPermission(String permission) { return new HashSet<>(Collections.singleton(Minecraft.getMinecraft().player)); } diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java index 98740c0..167aa94 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeServerSparkPlugin.java @@ -37,9 +37,10 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin { } @Override - public Set<ICommandSender> getSenders() { + public Set<ICommandSender> getSendersWithPermission(String permission) { MinecraftServer mcServer = FMLCommonHandler.instance().getMinecraftServerInstance(); Set<ICommandSender> senders = new HashSet<>(mcServer.getPlayerList().getPlayers()); + senders.removeIf(sender -> !sender.canUseCommand(4, permission)); senders.add(mcServer); return senders; } |