aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-12-10 10:01:58 +0000
committerLuck <git@lucko.me>2022-12-10 10:01:58 +0000
commit521cf8889ea4938b93691233178640fea06db69e (patch)
tree5b52a478dbabb9e8d4b46d1109bcffd7f8985acf /spark-fabric
parent1536537473aa5dead4c7353444e217df30d2ad96 (diff)
downloadspark-521cf8889ea4938b93691233178640fea06db69e.tar.gz
spark-521cf8889ea4938b93691233178640fea06db69e.tar.bz2
spark-521cf8889ea4938b93691233178640fea06db69e.zip
Give integrated server host all permissions
Diffstat (limited to 'spark-fabric')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java11
1 files changed, 9 insertions, 2 deletions
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 c528e5b..1606d57 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
@@ -119,8 +119,15 @@ public class FabricServerSparkPlugin extends FabricSparkPlugin implements Comman
@Override
public boolean hasPermission(CommandOutput sender, String permission) {
- if (sender instanceof PlayerEntity) {
- return Permissions.check(((PlayerEntity) sender), permission, 4);
+ if (sender instanceof PlayerEntity player) {
+ return Permissions.getPermissionValue(player, permission).orElseGet(() -> {
+ MinecraftServer server = player.getServer();
+ if (server != null && server.isHost(player.getGameProfile())) {
+ return true;
+ }
+
+ return player.hasPermissionLevel(4);
+ });
} else {
return true;
}