From 5656bea3f904b2d9d0c68d6340a4f2efa346e13d Mon Sep 17 00:00:00 2001 From: Luck Date: Fri, 21 Sep 2018 21:36:44 +0100 Subject: [PATCH] Update for latest Velocity changes --- .../me/lucko/luckperms/velocity/VelocitySenderFactory.java | 3 ++- .../velocity/listeners/MonitoringPermissionCheckListener.java | 4 ++-- .../luckperms/velocity/service/PlayerPermissionProvider.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/velocity/src/main/java/me/lucko/luckperms/velocity/VelocitySenderFactory.java b/velocity/src/main/java/me/lucko/luckperms/velocity/VelocitySenderFactory.java index 3c9925b8b..fbb81f56d 100644 --- a/velocity/src/main/java/me/lucko/luckperms/velocity/VelocitySenderFactory.java +++ b/velocity/src/main/java/me/lucko/luckperms/velocity/VelocitySenderFactory.java @@ -33,6 +33,7 @@ import me.lucko.luckperms.common.command.CommandManager; import me.lucko.luckperms.common.plugin.LuckPermsPlugin; import me.lucko.luckperms.common.sender.SenderFactory; import me.lucko.luckperms.common.utils.TextUtils; +import me.lucko.luckperms.velocity.service.CompatibilityUtil; import net.kyori.text.Component; @@ -71,7 +72,7 @@ public class VelocitySenderFactory extends SenderFactory { @Override protected Tristate getPermissionValue(CommandSource source, String node) { - return Tristate.fromBoolean(hasPermission(source, node)); + return CompatibilityUtil.convertTristate(source.getPermissionValue(node)); } @Override diff --git a/velocity/src/main/java/me/lucko/luckperms/velocity/listeners/MonitoringPermissionCheckListener.java b/velocity/src/main/java/me/lucko/luckperms/velocity/listeners/MonitoringPermissionCheckListener.java index 6ea6e02e4..94efb5c7a 100644 --- a/velocity/src/main/java/me/lucko/luckperms/velocity/listeners/MonitoringPermissionCheckListener.java +++ b/velocity/src/main/java/me/lucko/luckperms/velocity/listeners/MonitoringPermissionCheckListener.java @@ -82,8 +82,8 @@ public class MonitoringPermissionCheckListener { } @Override - public com.velocitypowered.api.permission.@NonNull Tristate getPermissionSetting(@NonNull String permission) { - com.velocitypowered.api.permission.Tristate setting = this.delegate.getPermissionSetting(permission); + public com.velocitypowered.api.permission.@NonNull Tristate getPermissionValue(@NonNull String permission) { + com.velocitypowered.api.permission.Tristate setting = this.delegate.getPermissionValue(permission); // report result Tristate result = CompatibilityUtil.convertTristate(setting); diff --git a/velocity/src/main/java/me/lucko/luckperms/velocity/service/PlayerPermissionProvider.java b/velocity/src/main/java/me/lucko/luckperms/velocity/service/PlayerPermissionProvider.java index 71f86b53f..d4b887194 100644 --- a/velocity/src/main/java/me/lucko/luckperms/velocity/service/PlayerPermissionProvider.java +++ b/velocity/src/main/java/me/lucko/luckperms/velocity/service/PlayerPermissionProvider.java @@ -56,7 +56,7 @@ public class PlayerPermissionProvider implements PermissionProvider, PermissionF } @Override - public @NonNull Tristate getPermissionSetting(@NonNull String permission) { + public @NonNull Tristate getPermissionValue(@NonNull String permission) { return CompatibilityUtil.convertTristate(this.user.getCachedData().getPermissionData(this.contextsSupplier.getContexts()).getPermissionValue(permission, CheckOrigin.PLATFORM_PERMISSION_CHECK)); } }