FunnyGuilds command framework based on top of the Panda dependency injection. Supported features:
- Dynamic loading of commands
- Configurable placeholders to extend annotation based API
- Customizable dependency injection
- Supports reloading
- Null safety
FunnyCommands artifact is available in repo.panda-lang.org repository.
Add these declarations to your pom.xml
.
<repositories>
<repository>
<id>reposilite-repository</id>
<name>Reposilite Repository</name>
<url>https://maven.reposilite.com/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.dzikoysk</groupId>
<artifactId>funnycommands</artifactId>
<version>0.7.4</version>
</dependency>
</dependencies>
Or in Gradle:
repositories {
maven { url "https://maven.reposilite.com/releases" }
}
dependencies {
implementation "net.dzikoysk:funnycommands:0.7.4"
}
Requirements:
- Java 8 or higher
- Spigot 1.8.8 or higher
- Panda Utilities
As an example, we can take pointless /test <player> [guild]
command.
@FunnyComponent
private static final class TestCommand {
@FunnyCommand(
name = "${fc.test-alias}",
description = "Test command",
permission = "fc.test",
usage = "/${fc.test-alias} <player> [guild]",
completer = "online-players:5 guilds:5",
parameters = "player:target [guild:arg-guild]"
)
SenderResponse test(CommandSender sender, @Arg("target") @Nullable Player target, @Arg("arg-guild") Option<Guild> guild) {
return new SenderResponse(target, "Test ${fc.time} > " + sender + " called " + target + " and " + guild.getOrNull());
}
}
The configuration for this kind of command may look like this:
this.funnyCommands = FunnyCommands.configuration(() -> this)
.registerDefaultComponents()
.placeholders(PLACEHOLDERS)
.type(new PlayerType(super.getServer()))
.type("guild", ((context, required, guild) -> guildService.guilds.get(guild)))
.hook();
#soonâ„¢
At this moment you can see full and up-to-date example in FunnyCommandsAcceptanceTestPlugin class