Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 π¨
- Host: GitHub
- URL: https://github.com/funnyguilds/funnycommands
- Owner: FunnyGuilds
- License: apache-2.0
- Created: 2020-04-01T21:58:55.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T15:03:01.000Z (2 months ago)
- Last Synced: 2024-10-22T01:17:45.378Z (2 months ago)
- Topics: bukkit, command-framework, funnyguilds, spigot
- Language: Java
- Homepage:
- Size: 399 KB
- Stars: 14
- Watchers: 5
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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