Class CommandTreeCleaner


  • class CommandTreeCleaner
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <S> com.mojang.brigadier.tree.RootCommandNode<S> cleanArgumentTypes​(com.mojang.brigadier.tree.RootCommandNode<S> root, java.util.function.Predicate<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeFilter)
      Cleans the command tree starting at the given root node from any argument types that do not match the given predicate.
      private static <S> com.mojang.brigadier.tree.CommandNode<S> cloneNode​(com.mojang.brigadier.tree.CommandNode<S> node, java.util.function.Predicate<com.mojang.brigadier.tree.CommandNode<?>> nodeFilter, java.util.Map<com.mojang.brigadier.tree.CommandNode<S>,​com.mojang.brigadier.tree.CommandNode<S>> newNodes)  
      private static <S> com.mojang.brigadier.tree.CommandNode<S> processCommandNode​(com.mojang.brigadier.tree.CommandNode<S> node, java.util.function.Predicate<com.mojang.brigadier.tree.CommandNode<?>> nodeFilter, java.util.Map<com.mojang.brigadier.tree.CommandNode<S>,​com.mojang.brigadier.tree.CommandNode<S>> newNodes)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CommandTreeCleaner

        CommandTreeCleaner()
    • Method Detail

      • cleanArgumentTypes

        public static <S> com.mojang.brigadier.tree.RootCommandNode<S> cleanArgumentTypes​(com.mojang.brigadier.tree.RootCommandNode<S> root,
                                                                                          java.util.function.Predicate<com.mojang.brigadier.arguments.ArgumentType<?>> argumentTypeFilter)
        Cleans the command tree starting at the given root node from any argument types that do not match the given predicate. Any ArgumentCommandNodes that have an unmatched argument type will be stripped from the tree.
        Returns:
        A new command tree, stripped of any unmatched argument types
      • processCommandNode

        private static <S> com.mojang.brigadier.tree.CommandNode<S> processCommandNode​(com.mojang.brigadier.tree.CommandNode<S> node,
                                                                                       java.util.function.Predicate<com.mojang.brigadier.tree.CommandNode<?>> nodeFilter,
                                                                                       java.util.Map<com.mojang.brigadier.tree.CommandNode<S>,​com.mojang.brigadier.tree.CommandNode<S>> newNodes)
      • cloneNode

        private static <S> com.mojang.brigadier.tree.CommandNode<S> cloneNode​(com.mojang.brigadier.tree.CommandNode<S> node,
                                                                              java.util.function.Predicate<com.mojang.brigadier.tree.CommandNode<?>> nodeFilter,
                                                                              java.util.Map<com.mojang.brigadier.tree.CommandNode<S>,​com.mojang.brigadier.tree.CommandNode<S>> newNodes)