File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
AdvancedCore/src/main/java/com/bencodez/advancedcore/api/user Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -687,6 +687,10 @@ public boolean hasLoggedOnBefore() {
687687 }
688688
689689 public boolean hasPermission (String perm ) {
690+ return hasPermission (perm , true );
691+ }
692+
693+ public boolean hasPermission (String perm , boolean offlineCheck ) {
690694 boolean negate = perm != null && perm .startsWith ("!" );
691695 if (negate ) {
692696 perm = perm .substring (1 );
@@ -703,6 +707,11 @@ public boolean hasPermission(String perm) {
703707 return negate ? !has : has ;
704708 }
705709
710+ if (!offlineCheck ) {
711+ plugin .debug ("Unable to get player for permission check for " + getPlayerName () + "/" + getUUID ()
712+ + " (offlineCheck is false)" );
713+ return false ;
714+ }
706715 // Offline path: LuckPerms (if available)
707716 if (plugin .getLuckPermsHandle () != null && plugin .getLuckPermsHandle ().luckpermsApiLoaded ()) {
708717 boolean has = plugin .getLuckPermsHandle ().hasPermission (getJavaUUID (), perm );
You can’t perform that action at this time.
0 commit comments