// Path: src/main/java/org/tyrannyofheaven/bukkit/util/permissions/PermissionUtils.java
// public static boolean hasPermissions(Permissible permissible, boolean all, String... permissions) {
//     return hasPermissions(permissible, all, false, permissions);
// }


import static org.tyrannyofheaven.bukkit.util.permissions.PermissionUtils.hasPermissions;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.bukkit.permissions.Permissible;
            
            // Add varargs description, if any
            if (cmd.getRest() != null) {
                usage.append(usageOptions.getVarargsStart());
                usage.append(cmd.getRest());
                usage.append(usageOptions.getVarargsEnd());
            }

            if (i.hasNext())
                usage.append(' ');
        }

        // Attach description
        if (withDescription && !chain.isEmpty()) {
            // Pull out last CommandMetaData
            CommandMetaData cmd = chain.get(chain.size() - 1).getCommandMetaData();
            if (cmd.getDescription() != null) {
                usage.append(usageOptions.getDescriptionDelimiter());
                usage.append(cmd.getDescription());
            }
        }
        
        usage.append(usageOptions.getPostamble());

        return usage.toString();
    }

    // Tests whether the given permissible can execute this entire chain
    boolean canBeExecutedBy(Permissible permissible) {
        for (CommandInvocation ci : chain) {
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/permissions/PermissionUtils.java
// public static boolean hasPermissions(Permissible permissible, boolean all, String... permissions) {
//     return hasPermissions(permissible, all, false, permissions);
// }


// Path: src/main/java/org/tyrannyofheaven/bukkit/util/command/InvocationChain.java
import static org.tyrannyofheaven.bukkit.util.permissions.PermissionUtils.hasPermissions;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.bukkit.permissions.Permissible;

            
            // Add varargs description, if any
            if (cmd.getRest() != null) {
                usage.append(usageOptions.getVarargsStart());
                usage.append(cmd.getRest());
                usage.append(usageOptions.getVarargsEnd());
            }

            if (i.hasNext())
                usage.append(' ');
        }

        // Attach description
        if (withDescription && !chain.isEmpty()) {
            // Pull out last CommandMetaData
            CommandMetaData cmd = chain.get(chain.size() - 1).getCommandMetaData();
            if (cmd.getDescription() != null) {
                usage.append(usageOptions.getDescriptionDelimiter());
                usage.append(cmd.getDescription());
            }
        }
        
        usage.append(usageOptions.getPostamble());

        return usage.toString();
    }

    // Tests whether the given permissible can execute this entire chain
    boolean canBeExecutedBy(Permissible permissible) {
        for (CommandInvocation ci : chain) {
            if (!hasPermissions(permissible, ci.getCommandMetaData().isRequireAll(), ci.getCommandMetaData().isCheckNegations(), ci.getCommandMetaData().getPermissions()))