Skip to content

Releases: vaperion/blade

2.1.3

06 Mar 12:33
29e8857
Compare
Choose a tag to compare
Added subcommand tabcompletion, unregister method

2.1.2

02 Jan 14:38
af746e5
Compare
Choose a tag to compare

Fixed annotation checking (fixes argument providers).

Fix for 2.1.0

01 Jan 21:30
e3f4c29
Compare
Choose a tag to compare
2.1.1

Bump version to 2.1.1

2.1.0

01 Jan 21:24
f27ba17
Compare
Choose a tag to compare
  • 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

20 Nov 11:16
d832465
Compare
Choose a tag to compare
Fixed UnsupportedOperationException

2.0.0

17 Nov 16:20
18c5413
Compare
Choose a tag to compare

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 reserved null 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 called ignoreFailedArgumentParse. 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

1.2.10

16 Oct 22:35
925fe31
Compare
Choose a tag to compare
Bump version in pom

1.2.9

17 Aug 15:50
Compare
Choose a tag to compare
Bumped version to 1.2.9

1.2.8

17 Aug 15:26
Compare
Choose a tag to compare
Bumped version to 1.2.8 in README.md

1.2.7

08 Aug 16:16
8b140f6
Compare
Choose a tag to compare
Bump version