Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/electroid/intake
Easy-to-use framework for creating commands, especially in Minecraft
https://github.com/electroid/intake
bukkit command-line java minecraft
Last synced: 3 months ago
JSON representation
Easy-to-use framework for creating commands, especially in Minecraft
- Host: GitHub
- URL: https://github.com/electroid/intake
- Owner: Electroid
- License: lgpl-3.0
- Created: 2018-08-18T22:24:18.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T22:22:03.000Z (over 2 years ago)
- Last Synced: 2024-10-12T03:42:57.550Z (4 months ago)
- Topics: bukkit, command-line, java, minecraft
- Language: Java
- Homepage:
- Size: 357 KB
- Stars: 40
- Watchers: 7
- Forks: 12
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Intake
Intake is a command parsing library that can be implemented along various platforms, such as Minecraft.
When a user inputs a command:
```
/sum 1 2
```You can easily handle that request with only a couple lines of code.
```java
public class Commands {
@Command(
aliases = "sum",
desc = "Adds two numbers and returns their result",
perms = "math.sum",
usage = "[number] [number]"
)
public void sum(CommandSender user, int a, int b) {
user.sendMessage(a + b);
}
}
```Intake allows you to define custom providers for your own classes and handle errors with ease. Check out the [detailed breakdown](core/README.md) of the project for more details.
## Example
To see how easy it is to implement Intake, take a look at the [Bukkit](bukkit/src/main/java/app/ashcon/intake/bukkit) module. For game developers that want to extend that module specifically, all you need to do is add this to your `JavaPlugin` class:
```java
@Override
public void onLoad() {
BasicBukkitCommandGraph cmdGraph = new BasicBukkitCommandGraph();
cmdGraph.getRootDispatcherNode().registerCommands(new Commands());
new BukkitIntake(this, cmdGraph).register();
}
```An example `Bukkit` plugin is provided for your convenience [here](examples/bukkit/src/main/java/app/ashcon/intake/example/).
## Installation
Release and snapshot artifacts are automatically deployed to my Nexus repo. Include the following snippet in your `pom.xml` to start using Intake.
```xml
ashcon.app
https://repo.ashcon.app/nexus/content/repositories/snapshots/
app.ashcon.intake
intake-bukkit
1.3-SNAPSHOT
```
## Compiling
Use Maven to compile Intake.
```
mvn clean install
```## Attributions
Intake was adapted from [sk89q's abandoned fork](https://github.com/EngineHub/Intake), but heavily modified and abstracted. Therefore, it is available under the GNU Lesser General Public License.
I happily accept contributions, especially through pull requests on GitHub!