Skip to content

Commit d8963b0

Browse files
committed
Add LICENSE.txt, update README.md
1 parent 3502726 commit d8963b0

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) [2024] [Jiří Apjár]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# ForestCommandAPI
2+
3+
![badge](https://img.shields.io/github/v/release/ForestTechMC/ForestCommandAPI)
4+
[![badge](https://jitpack.io/v/ForestTechMC/ForestCommandAPI.svg)](https://jitpack.io/#ForestTechMC/ForestCommandAPI)
5+
![badge](https://img.shields.io/github/downloads/ForestTechMC/ForestCommandAPI/total)
6+
![badge](https://img.shields.io/github/last-commit/ForestTechMC/ForestCommandAPI)
7+
![badge](https://img.shields.io/badge/platform-PaperMC-lightgrey)
8+
[![badge](https://img.shields.io/discord/896466173166747650?label=discord)](https://discord.gg/2PpdrfxhD4)
9+
[![badge](https://img.shields.io/github/license/ForestTechMC/ForestRedisAPI)](https://github.com/ForestTechMC/ForestCommandAPI/blob/master/LICENSE.txt)
10+
11+
Simple, but powerful annotation-based multiplatform command API inspired by many of the available APIs.
12+
13+
⚠️ **Project is at the beginning of development! We recommend not to use it right now!** ⚠️
14+
15+
## Table of contents
16+
17+
* [Getting started](#getting-started)
18+
* [Usage](#usage)
19+
* [License](#license)
20+
21+
## Getting started
22+
23+
This API works as library - it does not require to install any file to the server.
24+
25+
### Add ForestCommandAPI to your project
26+
27+
[![badge](https://jitpack.io/v/ForestTechMC/ForestCommandAPI.svg)](https://jitpack.io/#ForestTechMC/ForestCommandAPI)
28+
29+
First, you need to setup the dependency on the ForestCommandAPI.
30+
Replace **VERSION** with the version of the release.
31+
Replace **PLATFORM** with the name of the supported platforms (currently "paper", in the future "velocity", "spigot" and "bungeecord" will follow).
32+
33+
<details>
34+
<summary>Maven</summary>
35+
36+
```xml
37+
<repositories>
38+
<repository>
39+
<id>jitpack.io</id>
40+
<url>https://jitpack.io</url>
41+
</repository>
42+
</repositories>
43+
44+
<dependencies>
45+
<dependency>
46+
<groupId>com.github.ForestTechMC.ForestCommandAPI</groupId>
47+
<artifactId>PLATFORM</artifactId>
48+
<version>VERSION</version>
49+
</dependency>
50+
</dependencies>
51+
```
52+
</details>
53+
54+
<details>
55+
<summary>Gradle</summary>
56+
57+
```gradle
58+
allprojects {
59+
repositories {
60+
...
61+
maven { url 'https://jitpack.io' }
62+
}
63+
}
64+
65+
dependencies {
66+
implementation 'com.github.ForestTechMC.ForestCommandAPI:PLATFORM:VERSION'
67+
}
68+
```
69+
</details>
70+
71+
## Usage
72+
73+
MyCommand.java
74+
```java
75+
// Use onEnable or similar method based on the platform
76+
@Command(name = "mycmd")
77+
public class MyCommand implements CommandProcessor {
78+
79+
@SubCommand
80+
public void defaultNoArgs(CommandSender commandSender) {
81+
commandSender.sendMessage("Command with no args!");
82+
}
83+
84+
@SubCommand(names = "first")
85+
public void prefixNoArgs(CommandSender commandSender) {
86+
commandSender.sendMessage("Sub-command with no args!");
87+
}
88+
89+
@SubCommand(names = "second")
90+
public void prefixWithArgs(CommandSender commandSender, @Arg(name="arg1") String arg1, @Arg(name="int-arg", required=false) Integer arg2) {
91+
commandSender.sendMessage("Sub-command with args: " + arg1 + " " + arg2);
92+
}
93+
94+
}
95+
```
96+
97+
Main.java
98+
```java
99+
// Use onEnable or similar method based on the platform
100+
@Override
101+
public void onEnable() {
102+
CommandAPI commandAPI = new CommandAPI(this); // plugin main as the argument
103+
104+
}
105+
```
106+
107+
## License
108+
ForestCommandAPI is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/ForestTechMC/ForestCommandAPI/blob/master/LICENSE.txt) for more information.

0 commit comments

Comments
 (0)