Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork26
LiteCommands v3.7.0
Compare
Could not load tags
Nothing to show
{{ refName }}defaultLoading
· 111 commits to master since this release
What's Changed
- GH-440 Add Hacktoberfest 11 benner to README.md by@Rollczi in#440
- GH-441 Update README.md by@Rollczi in#441
- GH-427 Support async parse result. by@Rollczi in#435
- GH-442 Change default nativeMap of BiHashMap to ConcurrentHashMap by@OOP-778 in#443
- GH-445 Factories Unification by@SfenKer in#445
- GH-446 Hot fix offline player NPE. by@Rollczi in#447
Thanks@OOP-778 for the important bug fix ❤️
🟢 Add alias for@Context
annotation
@Command(name ="hello")publicclassHelloCommand {@Executevoidcommand(@SenderCommandSendersender,@ArgStringname) {// ... }}
🟢 Add an option to create Annotation aliases like as@Sender
You can implement your annotation:
@Retention(RetentionPolicy.RUNTIME)@Target(ElementType.PARAMETER)@RequirementDefinition(type =RequirementDefinition.Type.CONTEXT)public @interfaceMySender {}
And use it in your commands:
@Executevoidcommand(@MySenderCommandSendersender,@ArgStringname) {// ... }
🟢 Support completableFuture/async parse/context result:
publicclassUserArgumentResolverextendsArgumentResolver<CommandSender,User> {privatefinalPatternVALID_USER_PATTERN =Pattern.compile("^[a-zA-Z0-9_]{3,16}$");privatefinalUserServiceuserService;publicUserArgumentResolver(UserServiceuserService) {this.userService =userService; }@OverrideprotectedParseResult<User>parse(Invocation<CommandSender>invocation,Argument<User>context,Stringargument) {CompletableFuture<ParseResult<User>>userNotFound =userService.getUser(argument) .thenApply(user ->user !=null ?ParseResult.success(user) :ParseResult.failure("User not found"));returnParseResult.completableFuture(userNotFound); }@Overridepublicbooleanmatch(Invocation<CommandSender>invocation,Argument<User>context,Stringargument) {returnVALID_USER_PATTERN.matcher(argument).matches(); }}
🟢 when you call blocking methods you can useParseResult.async()
@OverrideprotectedParseResult<User>parse(Invocation<CommandSender>invocation,Argument<User>context,Stringargument) {returnParseResult.async(() ->userDatabase.getUser(argument)); }
🟢 See also same API for ContextResult
ContextResult.completableFuture()
ContextResult.async()
🔴 Removed wrapper API
🔴 Breaking changes (Internal API)
See more#435
Update dependencies
implementation("dev.rollczi:{artifact}:3.7.0")
<dependency> <groupId>dev.rollczi</groupId> <artifactId>{artifact}</artifactId> <version>3.7.0</version></dependency>
{artifact}
withplatform artifact
New Contributors
Full Changelog:v3.6.1...v3.7.0
Assets2
Uh oh!
There was an error while loading.Please reload this page.