- Fixed provider annotations (ProviderAnnotation class has been removed, use your own annotations)
- Added optional Data annotation that can pass additional information to argument providers.
@Command("test")
@Permission("@world")
void testCommand(@Sender CommandSender sender, @Name("test") @Data("hello") String argument) {}
@Nullable
@Override
public String provide(@NotNull BladeContext ctx, @NotNull BladeArgument arg) throws BladeExitMessage {
System.out.println(arg.getData()); // Prints: ["hello"]
}
- Added permission predicates, you can now register custom predicates using the Blade builder and use
@predicate
as the permission to check the predicate.
Blade.of()
...
.registerPermissionPredicate("world", (context, command) -> true)
...
@Command("test")
@Permission("@world")
void testCommand(@Sender CommandSender sender) {}
- Added
Blade#registerPackage
to make command registration easier. This will loop through all classes provided in the package and register them.
Blade.of()
...
.build()
.registerPackage(YourPlugin.class, "me.yourname.yourplugin.commands")
...