Skip to content

FunnyGuilds commands framework based on top of the Panda dependency injection 🔨

License

Notifications You must be signed in to change notification settings

FunnyGuilds/FunnyCommands

Repository files navigation

FunnyCommands FunnyCommands CI maven

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

Install

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

Preview

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

Guides

#soonâ„¢

At this moment you can see full and up-to-date example in FunnyCommandsAcceptanceTestPlugin class

About

FunnyGuilds commands framework based on top of the Panda dependency injection 🔨

Topics

Resources

License

Stars

Watchers

Forks

Languages