Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/funnyguilds/funnycommands

FunnyGuilds commands framework based on top of the Panda dependency injection πŸ”¨
https://github.com/funnyguilds/funnycommands

bukkit command-framework funnyguilds spigot

Last synced: about 2 months ago
JSON representation

FunnyGuilds commands framework based on top of the Panda dependency injection πŸ”¨

Awesome Lists containing this project

README

        

# FunnyCommands ![FunnyCommands CI](https://github.com/FunnyGuilds/FunnyCommands/actions/workflows/gradle.yml/badge.svg) ![maven](https://maven.reposilite.com/api/badge/latest/releases/net/dzikoysk/funnycommands?color=40c14a&name=Latest%20Release&prefix=v)

FunnyGuilds command framework based on top of the [Panda](https://github.com/panda-lang/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](https://repo.panda-lang.org/) repository.
Add these declarations to your `pom.xml`.

```xml


reposilite-repository
Reposilite Repository
https://maven.reposilite.com/releases


net.dzikoysk
funnycommands
0.7.4

```

Or in Gradle:

```groovy
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 [guild]` command.

```java
@FunnyComponent
private static final class TestCommand {

@FunnyCommand(
name = "${fc.test-alias}",
description = "Test command",
permission = "fc.test",
usage = "/${fc.test-alias} [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) {
return new SenderResponse(target, "Test ${fc.time} > " + sender + " called " + target + " and " + guild.getOrNull());
}

}
```

The configuration for this kind of command may look like this:

```java
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](https://github.com/FunnyGuilds/FunnyCommands/blob/master/funnycommands-test/src/main/java/net/dzikoysk/funnycommands/acceptance/FunnyCommandsAcceptanceTestPlugin.java) class