private void refreshAutoOp(Player player) {
        User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
        boolean value;

        if (user != null) {
            QueryOptions queryOptions = this.plugin.getContextManager().getQueryOptions(player);
            Map<String, Boolean> permData = user.getCachedData().getPermissionData(queryOptions).getPermissionMap();
            value = permData.getOrDefault(NODE, false);
        } else {
            value = false;
        }

        player.setOp(value);
    }
Implements the LuckPerms auto op feature.
nukkit/src/main/java/me/lucko/luckperms/nukkit/listeners/NukkitAutoOpListener.java