All Downloads are FREE. Search and download functionalities are using the official Maven repository.

personthecat.catlib.command.annotations.CommandBuilder Maven / Gradle / Ivy

Go to download

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 {}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy