Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.pogostick29dev.economy29;
- import java.lang.annotation.ElementType;
- import java.lang.annotation.Retention;
- import java.lang.annotation.RetentionPolicy;
- import java.lang.annotation.Target;
- @Retention(RetentionPolicy.RUNTIME)
- @Target(ElementType.TYPE)
- public @interface CommandData {
- String getName();
- String getDescription();
- String getArgs();
- }
- // Annotating a class with @CommandData:
- @CommandData(getName="Add", getDescription="Add money to balance.", getArgs="<player> <amount>")
- // Getting information stored in @CommandData for a given class:
- for (EcoCommand c : cmds) {
- CommandData data = c.getClass().getAnnotation(CommandData.class);
- sender.sendMessage("/eco " + data.getName() + " " + data.getArgs() + " - " + data.getDescription());
- }
Advertisement
Add Comment
Please, Sign In to add comment