Don't log permission checks for console

This commit is contained in:
Ben Woo 2025-01-17 16:47:24 +08:00
parent 51731cd178
commit 4dc61634bd

View File

@ -2,6 +2,7 @@ package org.mvplugins.multiverse.core.permissions;
import com.dumptruckman.minecraft.util.Logging;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
public final class PermissionUtils {
@ -39,12 +40,12 @@ public final class PermissionUtils {
*/
public static boolean hasPermission(CommandSender sender, String permission) {
if (sender.hasPermission(permission)) {
if (debugPermissions) {
if (debugPermissions && !(sender instanceof ConsoleCommandSender)) {
Logging.finer("Checking sender [%s] has permission [%s] : YES", sender.getName(), permission);
}
return true;
}
if (debugPermissions) {
if (debugPermissions && !(sender instanceof ConsoleCommandSender)) {
Logging.finer("Checking sender [%s] has permission [%s] : NO", sender.getName(), permission);
}
return false;