Releases: Rollczi/LiteCommands
LiteCommands v3.6.0
What's Changed
- GH-357 Add priority api, strict mode, event api and @DefaultExecute. Snapshot 3.6.0-SNAPSHOT by @Rollczi in #366
- GH-412 Remove panda sdk and expiringmap by @Rollczi in #430
- GH-431 Use Versions.kt object to centralize versions. by @vLuckyyy in #433
- GH-434 Hot fix BukkitScheduler by @Rollczi in #434
Thanks @vLuckyyy
🟢 Add an option to disable strict mode.
If you disable strict mode for a command, then users will be able to add unexpected arguments e.g.
/help first asdfioaosdf asodfn asodimf
<- this will work!
@Command(name = "help", strict = StrictMode.DISABLED)
class HelpCommand {
@Execute
void helpCommand(@Arg String arg) {
}
}
You can also disable strict mode by calling:
.strictMode(StrictMode.DISABLED);
on builder.
@ExecuteDefault
@Command(name = "kick")
public class KickCommand {
@ExecuteDefault
void commandHelp(@Context SENDER sender) {
// /kick incorrect input
}
@Execute(name = "-all")
void kickAll() {
// /kick -all
}
}
@Priority
@Command(name = "test")
public class TestCommand {
@Execute
@Priority(PriorityValue.HIGH)
void execute(int number) {
// ...
}
@Execute
@Priority(PriorityValue.LOW)
void execute(String text) {
// ...
}
}
Available events:
- CandidateExecutorFoundEvent
- CandidateExecutorMatchEvent
- CommandPreExecutionEvent
- CommandPostExecutionEvent
Simple example, how to block the execution of a command:
public class TellCommandController<SENDER> implements EventListener {
@Subscriber
public void onEvent(CommandPreExecutionEvent<SENDER> event) {
SENDER sender = event.getInvocation().sender();
if (event.getInvocation().name().equals("tell") && sender.isMuted()) {
event.stopFlow(FailedReason.of("&cYou are muted!"));
}
}
}
Update dependencies
implementation("dev.rollczi:{artifact}:3.6.0")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.6.0</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.5.0...v3.6.0
LiteCommands v3.5.0
What's Changed
- GH-415 Add chained contexts by @Rollczi in #415
- GH-386 Add Varargs annotation and processor. by @Rollczi in #386
- GH-418 Add BukkitCommand#getCommandRoute by @Rollczi in #418
- GH-419 Fix Suggestion#of and number formatting. by @Rollczi in #419
- GH-420 Add an option to define permission, which allows bypassing cooldown by @rchomczyk in #420
- GH-421 Add missing api. Remove useless method. by @Rollczi in #421
- GH-423 Lazy load jakarta validator by @Rollczi in #423
- GH-424 Update example. Fix also legacy simple schematic generator. by @Rollczi in #424
- GH-425 Fix @OptionalArg annotation for the jda platform. by @Rollczi in #425
Thanks @rchomczyk ❤️
🟢 Added bypass for @Cooldown
@Command(name = "test")
@Cooldown(key = "key", count = 1, unit = SECONDS, bypass = "your.bypass")
public class TestCommand {
// ...
}
🟢 Added JakartaSettings#violationMessage
for value type
Example usage:
.violationMessage(Max.class, Integer.class, (invocation, violation) -> "Invalid value: " + violation.getInvalidValue() + " for " + violation.getParameterName())
⚠️ Experimental @Varargs
annotation
/numbers <numbers...>
@Command(name = "numbers")
public class NumbersCommand {
@Execute
void numbers(@Varargs(delimiter = ",") List<Double> numbers) {
// ...
}
}
Example input: /numbers 15,40.5,-1
⚠️ Experimental ContextChainedProvider
, ArgumentResolverChained
, BindChainedProvider
This can be helpful when you want to create a context/argument resolver/bind that is dependent on another.
Example for context:
public class GuildContextProvider<SENDER> implements ContextChainedProvider<SENDER, Guild> {
@Override
public ContextResult<LiteTestGuild> provide(Invocation<SENDER> invocation, ContextChainAccessor<SENDER> accessor) {
return accessor.provideContext(User.class, invocation)
.flatMap(user -> user.getGuild() == null
? ContextResult.error("User is not in a guild")
: ContextResult.ok(() -> user.getGuild())
);
}
}
🔴 Removed JakartaSettings#constraintViolationsMessage
Use JakartaSettings#violationMessage
instead.
Now If you want to join all violations into one message, then implement your ResultHandler for JakartaRawResult type.
Update dependencies
implementation("dev.rollczi:{artifact}:3.5.0")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.5.0</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.4.3...v3.5.0
LiteCommands v3.4.3
What's Changed
- GH-404 Add currency example with multi file command. by @Rollczi in #404
- GH-407 Add platform receiver. Fix rcon bukkit adventure platform bug. by @Rollczi in #407
- Add build-in context providers and argument resolvers for the velocity platform. by @Rollczi in #413
Update dependencies
implementation("dev.rollczi:{artifact}:3.4.3")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.4.3</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.4.2...v3.4.3
LiteCommands v3.4.2
What's Changed
- GH-396 Add result handler for arrays by @rchomczyk in #396
- GH-400 Add UUID argument resolver by @BlackBaroness in #400
- GH-401 Support inherited methods. by @Rollczi in #401
Thanks @rchomczyk @BlackBaroness @RyanTheTechMan ❤️
Update dependencies
implementation("dev.rollczi:{artifact}:3.4.2")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.4.2</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.4.1...v3.4.2
LiteCommands v3.4.1
What's Changed
- GH-390 Fix suggestions permission validation for children of command. by @Rollczi in #391
- GH-393 Add implementation for command cooldowns (
@Cooldown
); Fix typo in requirement package name by @rchomczyk in #393 - Release 3.4.1 by @Rollczi in #394
Update dependencies
implementation("dev.rollczi:{artifact}:3.4.1")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.4.1</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.4.0...v3.4.1
LiteCommands v3.4.0
What's Changed
- GH-307 Implement Fabric platform support by @huanmeng-qwq in #376
- GH-379 Fix range exception in join argument by @q1zZu in #380
- GH-381 Fix issue with merging a programmatic command. by @Rollczi in #381
Special thanks @huanmeng-qwq for implementing the Fabric platform in #376! ❤️ 🌟 🎊
New Contributors
Update dependencies
implementation("dev.rollczi:{artifact}:3.4.0")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.4.0</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.3.4...v3.4.0
v3.3.4
What's Changed
- GH-355 Enhance LiteCommands execution and argument resolving performance. by @Rollczi in #355
- GH-370 Add withoutExecutor() method (experimental API) and fix handling a InvalidUsageException in programmatic API. by @Rollczi in #370
- GH-230 Implement Sponge platform support by @BlackBaroness in #372
- GH-373 Fix errors in the findByInstanceOf method by @huanmeng-qwq in #373
Special thanks @huanmeng-qwq and @BlackBaroness for their help! ❤️
Update dependencies
implementation("dev.rollczi:{artifact}:3.3.4")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.3.4</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.3.3...v3.3.4
LiteCommands v3.3.3
What's Changed
- GH-367 Fix description assigning to jda slash command data. Add related unit tests. by @Rollczi in #367
- GH-368 Fix Console Identifier by @Rollczi in #368
Update dependencies
implementation("dev.rollczi:{artifact}:3.3.3")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.3.3</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.3.2...v3.3.3
LiteCommands v3.3.2
What's Changed
- GH-362 Add more docs and jetbrains annotations. by @Rollczi in #362
- GH-364 Fix jda description resolving. by @Rollczi in #364
- GH-363 Refactor and fix multiple suggestion resolving. by @Rollczi in #365
Update dependencies
implementation("dev.rollczi:{artifact}:3.3.2")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.3.2</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.3.1...v3.3.2
LiteCommands v3.3.1
What's Changed
- GH-359 Minestom: Add context providers and arguments for player and instance types. Use adventure extension. Add minestom example. Bump Minestom-CE version. Add default messages. by @Rollczi in #360
- GH-361 Support kotlin builder chain. by @Rollczi in #361
Update dependencies
implementation("dev.rollczi:{artifact}:3.3.1")
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>{artifact}</artifactId>
<version>3.3.1</version>
</dependency>
{artifact}
with platform artifact
Full Changelog: v3.3.0...v3.3.1