Repository: cloudnetservice/cloudnet-v3
Issue: SyncProxyModule only checks whitelist

The sync proxy modules does only check if the player is on the whitelist on maintenance and ignores that the player might have the permission to join.

Changed files:
cloudnet-modules/cloudnet-syncproxy/src/main/java/de/dytanic/cloudnet/ext/syncproxy/bungee/util/LoginPendingConnectionCommandSender.java
cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bungee/listener/BungeeCloudNetCloudPermissionsPlayerListener.java

diff --git a/cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bungee/listener/BungeeCloudNetCloudPermissionsPlayerListener.java b/cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bungee/listener/BungeeCloudNetCloudPermissionsPlayerListener.java
index b6bbd70b0..dbd9b0e19 100644
--- a/cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bungee/listener/BungeeCloudNetCloudPermissionsPlayerListener.java
+++ b/cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bungee/listener/BungeeCloudNetCloudPermissionsPlayerListener.java
@@ -11,6 +11,8 @@ import net.md_5.bungee.api.event.PlayerDisconnectEvent;
 import net.md_5.bungee.api.plugin.Listener;
 import net.md_5.bungee.event.EventHandler;
 
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.util.UUID;
 
 public final class BungeeCloudNetCloudPermissionsPlayerListener implements Listener {
@@ -24,9 +26,21 @@ public final class BungeeCloudNetCloudPermissionsPlayerListener implements Liste
     public void handle(PermissionCheckEvent event) {
         CommandSender sender = event.getSender();
 
+        UUID uniqueId = null;
+
         if (sender instanceof ProxiedPlayer) {
-            UUID uniqueId = ((ProxiedPlayer) sender).getUniqueId();
+            uniqueId = ((ProxiedPlayer) sender).getUniqueId();
+        } else {
+            try {
+                Method method = sender.getClass().getDeclaredMethod("getUniqueId");
+                uniqueId = (UUID) method.invoke(sender);
+            } catch (NoSuchMethodException ignored) {
+            } catch (IllegalAccessException | InvocationTargetException exception) {
+                exception.printStackTrace();
+            }
+        }
 
+        if (uniqueId != null) {
             IPermissionUser permissionUser = CloudPermissionsPermissionManagement.getInstance().getUser(uniqueId);
 
             if (permissionUser != null) {
diff --git a/cloudnet-modules/cloudnet-syncproxy/src/main/java/de/dytanic/cloudnet/ext/syncproxy/bungee/util/LoginPendingConnectionCommandSender.java b/cloudnet-modules/cloudnet-syncproxy/src/main/java/de/dytanic/cloudnet/ext/syncproxy/bungee/util/LoginPendingConnectionCommandSender.java
index e4260cf27..ee8e2c80d 100644
--- a/cloudnet-modules/cloudnet-syncproxy/src/main/java/de/dytanic/cloudnet/ext/syncproxy/bungee/util/LoginPendingConnectionCommandSender.java
+++ b/cloudnet-modules/cloudnet-syncproxy/src/main/java/de/dytanic/cloudnet/ext/syncproxy/bungee/util/LoginPendingConnectionCommandSender.java
@@ -98,7 +98,7 @@ public class LoginPendingConnectionCommandSender implements CommandSender {
     }
 
     public PendingConnection getPendingConnection() {
-        return pendingConnection;
+        return this.pendingConnection;
     }
 
     public UUID getUniqueId() {