diff options
-rw-r--r-- | spark-fabric/build.gradle | 2 | ||||
-rw-r--r-- | spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/spark-fabric/build.gradle b/spark-fabric/build.gradle index fb2a86f..4349f66 100644 --- a/spark-fabric/build.gradle +++ b/spark-fabric/build.gradle @@ -32,6 +32,8 @@ dependencies { modImplementation(fabricApi.module(it, '0.25.1+build.416-1.16')) } + include(modImplementation('me.lucko:fabric-permissions-api:0.1-SNAPSHOT')) + shade project(':spark-common') } 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 fbdc2e9..7ef0643 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 @@ -26,6 +26,8 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.suggestion.SuggestionProvider; import com.mojang.brigadier.suggestion.Suggestions; import com.mojang.brigadier.suggestion.SuggestionsBuilder; + +import me.lucko.fabric.api.permissions.v0.Permissions; import me.lucko.spark.common.platform.PlatformInfo; import me.lucko.spark.common.sampler.tick.TickHook; import me.lucko.spark.common.sampler.tick.TickReporter; @@ -111,7 +113,7 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman @Override public boolean hasPermission(CommandOutput sender, String permission) { if (sender instanceof PlayerEntity) { - return this.server.getPermissionLevel(((PlayerEntity) sender).getGameProfile()) >= 4; + return Permissions.check(((PlayerEntity) sender), permission, 4); } else { return true; } |