Skip to content

ultragrav/Commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Commands

A simple commands library for Spigot and Bungeecord

Installation

Maven:

<repository>
    <id>UltraGrav</id>
    <url>https://mvn.ultragrav.net</url>
</repository>

<dependency>
    <groupId>net.ultragrav</groupId>
    <artifactId>Commands</artifactId>
    <version>1.5.0</version>
</dependency>

Example Usage

ExampleCommand.java

import net.ultragrav.command.UltraCommand;

public class ExampleCommand extends UltraCommand {
    public ExampleCommand() {
        this.addAlias("example");

        this.addChildren(
                new ExampleSubCommand()
        );
    }
}

ExampleSubCommand.java

import net.ultragrav.command.Parameter;
import net.ultragrav.command.UltraCommand;
import net.ultragrav.command.provider.impl.StringProvider;

import java.util.List;

public class ExampleSubCommand extends UltraCommand {
    public ExampleSubCommand() {
        this.addAlias("sub");

        this.setAllowConsole(false);

        this.addParameter(Parameter.builder(StringProvider.getInstance()).name("message").varArg(true).build());
    }

    @Override
    protected void perform() {
        List<String> message = getArgument(0);

        tell(String.join(" ", message));
    }
}

How to register:

new ExampleCommand().register();

Full documentation coming soon

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •