Class AbstractCommand.CommandTree

java.lang.Object
com.ldtteam.structurize.commands.AbstractCommand.CommandTree
Enclosing class:
AbstractCommand

protected static class AbstractCommand.CommandTree extends Object
Class for building command trees efectively
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    CommandTree(net.minecraft.commands.Commands.CommandSelection environment, String commandName)
    Creates new command tree.
  • Method Summary

    Modifier and Type
    Method
    Description
    Adds new tree as leaf into this tree.
    addNode(Supplier<com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack>> commandBuilder, Supplier<net.minecraft.commands.Commands.CommandSelection> commandEnviroment)
    Adds new command as leaf into this tree.
    protected Optional<com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack>>
    build(net.minecraft.commands.Commands.CommandSelection environment)
    Builds whole tree for dispatcher.
     
    protected void
    register(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> commandDispatcher, net.minecraft.commands.Commands.CommandSelection serverEnvironmentType)
     

    Methods inherited from class java.lang.Object

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

    • CommandTree

      protected CommandTree(net.minecraft.commands.Commands.CommandSelection environment, String commandName)
      Creates new command tree.
      Parameters:
      commandName - root vertex name
  • Method Details

    • newRootNode

      protected static AbstractCommand.CommandTree newRootNode()
      Returns:
      constructs new root node
    • addNode

      Adds new tree as leaf into this tree.
      Parameters:
      tree - new tree to add
      Returns:
      this
    • addNode

      protected AbstractCommand.CommandTree addNode(Supplier<com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack>> commandBuilder, Supplier<net.minecraft.commands.Commands.CommandSelection> commandEnviroment)
      Adds new command as leaf into this tree.
      Parameters:
      commandBuilder - command to add
      commandEnviroment - command's enviroment getter
      Returns:
      this
    • build

      protected Optional<com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack>> build(net.minecraft.commands.Commands.CommandSelection environment)
      Builds whole tree for dispatcher.
      Returns:
      tree as command node
    • register

      protected void register(com.mojang.brigadier.CommandDispatcher<net.minecraft.commands.CommandSourceStack> commandDispatcher, net.minecraft.commands.Commands.CommandSelection serverEnvironmentType)