From 521cf8889ea4938b93691233178640fea06db69e Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 10 Dec 2022 10:01:58 +0000 Subject: Give integrated server host all permissions --- .../me/lucko/spark/fabric/plugin/FabricServerSparkPlugin.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'spark-fabric/src/main/java/me/lucko') 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; } -- cgit