Releases: vaperion/blade
Releases · vaperion/blade
2.1.3
2.1.2
Fix for 2.1.0
2.1.1 Bump version to 2.1.1
2.1.0
- 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")
...
2.0.1
2.0.0
What has changed?
- Added a new
@Completer
annotation that you can use to specify a custom tab completer for each command parameter. - Changed package structure from
me.vaperion.blade.command
->me.vaperion.blade
. - Added a new
BladeArgument
class, that now gets passed to the argument providers instead of just an input string. This change lets us check whether the argument was provided in the command, or it's a default value, so we can perform different actions on it (an example being the reservednull
value). - Added more documentation.
- Added
defaultPermissionMessage
to the blade builder, you can now specify a default message instead of having to configure it for each command separately (although you can still do this if you want a different message for some commands). - Added a new
section(String)
method to the blade builder that you can use to change the fallback prefix for some commands if you want to use the same blade object for multiple plugins. - The old default help generator was renamed to
NoOpHelpGenerator
and replaced with a basic generator that displays all the commands available to the command sender. - Added a new setting to the
@Optional
annotation calledignoreFailedArgumentParse
. When this is true, if the argument provider fails to parse this type it will pass null instead of showing the usage message to the sender (for example, if an invalid player is provided it will return null). - Fixed: #3 #2 #12