personthecat.catlib.command.annotations.CommandBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of catlib-quilt Show documentation
Show all versions of catlib-quilt Show documentation
Utilities for serialization, commands, noise generation, IO, and some new data types.
The newest version!
package personthecat.catlib.command.annotations;
import personthecat.catlib.command.LibCommandBuilder;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that a method returns a {@link LibCommandBuilder} and should be
* added into the registration context when processing this class file.
*
* This annotation should only be added to static methods consuming
* no parameters and returning an instance of {@link LibCommandBuilder}.
*
* For example:
*
{@code
* @CommandBuilder
* private static LibCommandBuilder myCommand() {
* return LibCommandBuilder.named("command")
* .append("Runs a generic command")
* .wrap("", wrapper -> wrapper.sendMessage("Hello, world!"))
* .generate((builder, wrappers) ->
* builder.executes(wrappers.get("")));
* }
* }
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CommandBuilder {}