From d7c9c59b75d1647167ab61aac0aff7a32448d0bb Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 27 Jun 2020 20:22:51 -0500 Subject: [PATCH] More sponge perm work on 1.12.2 --- .../permissions/Sponge7Permissions.java | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/permissions/Sponge7Permissions.java b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/permissions/Sponge7Permissions.java index e627aeec..659f0812 100644 --- a/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/permissions/Sponge7Permissions.java +++ b/forge-1.12.2/src/main/java/org/dynmap/forge_1_12_2/permissions/Sponge7Permissions.java @@ -32,31 +32,12 @@ public class Sponge7Permissions implements PermissionProvider { @Override public boolean has(ICommandSender sender, String permission) { - if(sender instanceof EntityPlayerMP) { - boolean rc = false; - EntityPlayerMP player = (EntityPlayerMP) sender; - Optional p = Sponge.getServer().getPlayer(player.getUniqueID()); - if (p.isPresent()) { - - rc = p.get().hasPermission("dynmap." + permission); - } - return rc; - } - return true; + return sender.canUseCommand(4, "dynmap." + permission); } @Override public boolean hasPermissionNode(ICommandSender sender, String permission) { - if(sender instanceof EntityPlayerMP) { - boolean rc = false; - EntityPlayerMP player = (EntityPlayerMP) sender; - Optional p = Sponge.getServer().getPlayer(player.getUniqueID()); - if (p.isPresent()) { - rc = p.get().hasPermission("dynmap." + permission); - } - return rc; - } - return true; + return sender.canUseCommand(4, "dynmap." + permission); } @Override