More sponge perm work on 1.12.2

This commit is contained in:
Mike Primm 2020-06-27 20:22:51 -05:00
parent c258c5efa4
commit d7c9c59b75

View File

@ -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<Player> 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<Player> 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