docs: 完善文档
This commit is contained in:
54
README.md
54
README.md
@@ -1,10 +1,22 @@
|
|||||||
# [HamsterCore](https://gitee.com/MiniDay/hamster-core)
|
# [HamsterCore](https://git.airgame.net/MiniDay/hamster-core)
|
||||||
|
|
||||||
仓鼠核心:叁只仓鼠的 Minecraft 插件开发通用工具包
|
仓鼠核心:叁只仓鼠的 Minecraft 插件开发通用工具包
|
||||||
|
|
||||||
# 添加依赖
|
# 手动构建
|
||||||
|
|
||||||
## Gradle (`build.gradle`)
|
1. 将源代码下载或克隆至本地
|
||||||
|
2. 在源代码根目录中打开命令行窗口
|
||||||
|
3. 命令行窗口中执行`./gradlew clean build`
|
||||||
|
4. 构建成品在 `build` 文件夹
|
||||||
|
|
||||||
|
也可访问我的[Jenkins网站](https://jenkins.airgame.net/job/opensource/job/hamster-core/)获取最新版
|
||||||
|
|
||||||
|
# 开发
|
||||||
|
|
||||||
|
## 添加依赖
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Gradle(build.gradle)</summary>
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
// 添加仓库
|
// 添加仓库
|
||||||
@@ -22,7 +34,31 @@ dependencies {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Maven (`pom.xml`)
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Gradle(build.gradle.kts)</summary>
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
// 添加仓库
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url = uri("https://maven.airgame.net/maven-public/")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
// 对于 Bukkit 插件
|
||||||
|
compileOnly("cn.hamster3.mc.plugin:core-bukkit:+")
|
||||||
|
// 对于 BungeeCord 插件
|
||||||
|
compileOnly("cn.hamster3.mc.plugin:core-bungee:+")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Gradle(pom.xml)</summary>
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
|
|
||||||
@@ -52,3 +88,13 @@ dependencies {
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
## 使用 API
|
||||||
|
|
||||||
|
- 绝大部分 API 相关的方法都位于 `cn.hamster3.mc.plugin.core.common.api.CoreAPI` 类中
|
||||||
|
- 使用方法为:`CoreAPI.getInstance().xxx()`
|
||||||
|
- 部分通用的工具代码在 `cn.hamster3.mc.plugin.core.common.util` 包中
|
||||||
|
- 部分Bukkit的工具代码在 `cn.hamster3.mc.plugin.core.bukkit.util` 包中
|
||||||
|
- 部分BungeeCord的工具代码在 `cn.hamster3.mc.plugin.core.bungee.util` 包中
|
Reference in New Issue
Block a user