Search in sources :

Example 1 with CommandTreeBase

use of net.minecraftforge.server.command.CommandTreeBase in project Realistic-Terrain-Generation by Team-RTG.

the class RTGCommandTree method getUsage.

@Override
public String getUsage(ICommandSender sender) {
    final ITextComponent ret = new TextComponentString("");
    getSubCommands().forEach(cmd -> {
        if (cmd instanceof CommandTreeBase) {
            ((CommandTreeBase) cmd).getSubCommands().forEach(rcmd -> ret.appendText("\n").appendText(rcmd.getUsage(sender)));
        } else {
            ret.appendText("\n").appendText(cmd.getUsage(sender));
        }
    });
    return ret.getFormattedText();
}
Also used : ITextComponent(net.minecraft.util.text.ITextComponent) CommandTreeBase(net.minecraftforge.server.command.CommandTreeBase) TextComponentString(net.minecraft.util.text.TextComponentString)

Aggregations

ITextComponent (net.minecraft.util.text.ITextComponent)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 CommandTreeBase (net.minecraftforge.server.command.CommandTreeBase)1