Skip to content

Commit

Permalink
Cloud -> LiteCommands (#63)
Browse files Browse the repository at this point in the history
In this commit we had removed everything about Cloud, and switched to another command framework called LiteCommands.

Reviewed-by: xiaoACE6716, SNWCreations
Tested-by: huanmeng_qwq
  • Loading branch information
huanmeng-qwq authored Feb 13, 2024
1 parent afbf3ca commit 9ce8ef6
Show file tree
Hide file tree
Showing 38 changed files with 1,040 additions and 3,757 deletions.
48 changes: 48 additions & 0 deletions CLOUD_MIGRATE_TO_LITECOMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
### 从Cloud迁移到LiteCommands

### 注解

| Cloud | LiteCommands |
|------------------------|-----------------------|
| @CommandContainer | @RootCommand |
| @CommandMethod("test") | @Command(name="test") |
| @Argument | @Arg |

### 示例
#### Cloud

```java
@CommandContainer
@CommandPrefix("!")
@CommandMethod("test")
public class TestCloudCommand {
@CommandMethod("sub1 <parm1>")
public void sub1(CommandSender sender, Message message, @Argument("parm1") String parm1) {
// ...
}
}
```

#### LiteCommands
> Github: [LiteCommands](https://github.com/Rollczi/LiteCommands)
>
> IDEA中安装[LiteCommands](https://plugins.jetbrains.com/plugin/20799-litecommands)插件后,可以自动识别LiteCommands的注解,并能够很好的辅助开发。
```java
import dev.rollczi.litecommands.annotations.argument.Arg;
import dev.rollczi.litecommands.annotations.command.Command;
import dev.rollczi.litecommands.annotations.context.Context;
import dev.rollczi.litecommands.annotations.execute.Execute;
import snw.kookbc.impl.command.litecommands.annotations.prefix.Prefix;

@Command(name = "test")
@Prefix("!")
public class TestLiteCommand {
@Execute(name = "sub1")
public void sub1(@Context CommandSender sender,
@Context Message message,
@Arg("parm1") String parm1) {
// ...
}
}
```
17 changes: 8 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@
<id>architectury</id>
<url>https://maven.architectury.dev/</url>
</repository>
<repository>
<id>panda-repo</id>
<url>https://repo.panda-lang.org/releases</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -296,16 +300,11 @@
<version>${mixin.version}</version>
</dependency>

<!--Command - Cloud-->
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-core</artifactId>
<version>1.8.3</version>
</dependency>
<!--Command - litecommands-->
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-annotations</artifactId>
<version>1.8.3</version>
<groupId>dev.rollczi</groupId>
<artifactId>litecommands-framework</artifactId>
<version>3.3.4</version>
</dependency>

<dependency>
Expand Down
Loading

0 comments on commit 9ce8ef6

Please sign in to comment.