Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LiteCommands v3.7.0

Compare
Choose a tag to compare
Loading
@RollcziRollczi released this 13 Oct 12:12
· 111 commits to master since this release
98b803f
This commit was signed with the committer’sverified signature. The key has expired.
Rollczi Norbert Dejlich
GPG key ID:B8A68C41B7784F01
Expired
Verified
Learn about vigilant mode.

What's Changed

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));    }

⚠️When you return async/completableFuture result then you must also implement match method for correct suggestion validation

🟢 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>

⚠️ Replace{artifact} withplatform artifact

DiscordSponsor

New Contributors

Full Changelog:v3.6.1...v3.7.0

Contributors

  • @OOP-778
  • @SfenKer
  • @Rollczi
OOP-778, SfenKer, and Rollczi
Assets2
Loading

[8]ページ先頭

©2009-2025 Movatter.jp