docs: 更新Readme,编写些提示
This commit is contained in:
parent
9eec9972f4
commit
a5d00dad96
30
.github/workflows/styleCheck.yml
vendored
Normal file
30
.github/workflows/styleCheck.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: Check Style in Pull Request
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkstyle:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
checks: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: refs/pull/${{ github.event.number }}/merge
|
||||||
|
- name: Setup Java 17
|
||||||
|
uses: actions/setup-java@v3.6.0
|
||||||
|
with:
|
||||||
|
distribution: zulu
|
||||||
|
java-version: 17
|
||||||
|
- uses: reviewdog/action-setup@v1
|
||||||
|
with:
|
||||||
|
reviewdog_version: latest
|
||||||
|
- name: download checkstyle
|
||||||
|
run: curl -o checkstyle.jar -L https://github.com/checkstyle/checkstyle/releases/download/checkstyle-12.1.2/checkstyle-12.1.2-all.jar
|
||||||
|
- name: checkstyle
|
||||||
|
env:
|
||||||
|
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: java -jar checkstyle.jar -c style.xml -f xml src | reviewdog -f=checkstyle -name="Checkstyle" -reporter=github-pr-review -fail-level=any
|
||||||
39
README.md
39
README.md
|
|
@ -8,7 +8,7 @@
|
||||||
It provides utility methods and core functionality that other mods can build upon.
|
It provides utility methods and core functionality that other mods can build upon.
|
||||||
### How to implementation?
|
### How to implementation?
|
||||||
|
|
||||||
**In repositories:**
|
#### **In repositories:**
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
maven {
|
maven {
|
||||||
|
|
@ -17,10 +17,41 @@ It provides utility methods and core functionality that other mods can build upo
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**In dependencies:**
|
#### **In dependencies:**
|
||||||
|
##### General
|
||||||
|
**gradle.properties**
|
||||||
|
```properties
|
||||||
|
lib39_version=0.5.1
|
||||||
|
````
|
||||||
|
##### For Loom
|
||||||
|
**build.gradle**
|
||||||
```groovy
|
```groovy
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("top.r3944realms.lib39:lib39:1.20.1-0.4.1")
|
modImplementation("top.r3944realms.lib39:lib39-fabric-1.20.1:${lib39_version}")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### For ForgeGradle
|
||||||
|
**build.gradle**
|
||||||
|
```groovy
|
||||||
|
dependencies {
|
||||||
|
implementation fg.deof("top.r3944realms.lib39:lib39-forge-1.20.1:${lib39_version}")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### For NeoForgeGradle / ModDevGradle
|
||||||
|
**build.gradle**
|
||||||
|
```groovy
|
||||||
|
dependencies {
|
||||||
|
modImplementation("top.r3944realms.lib39:lib39-forge-1.20.1:${lib39_version}")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
##### For MultiLoader Project
|
||||||
|
Add this in your common subproject.
|
||||||
|
**build.gradle**
|
||||||
|
```groovy
|
||||||
|
dependencies {
|
||||||
|
implementation("top.r3944realms.lib39:lib39-common-1.20.1:${lib39_version}")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
@ -5,20 +5,26 @@ import top.r3944realms.lib39.Lib39;
|
||||||
import top.r3944realms.lib39.core.command.SimpleCommandHelpManager;
|
import top.r3944realms.lib39.core.command.SimpleCommandHelpManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type Lib 39 command help manager.
|
* <pre>
|
||||||
|
* 命令帮助注册管理类
|
||||||
|
* 这是一个模组内置的示例
|
||||||
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public class Lib39CommandHelpManager extends SimpleCommandHelpManager {
|
public class Lib39CommandHelpManager extends SimpleCommandHelpManager {
|
||||||
/**
|
/**
|
||||||
* The constant INSTANCE.
|
* 单例模式
|
||||||
*/
|
*/
|
||||||
public static volatile Lib39CommandHelpManager INSTANCE = new Lib39CommandHelpManager();
|
public static volatile Lib39CommandHelpManager INSTANCE = new Lib39CommandHelpManager();
|
||||||
/**
|
/**
|
||||||
* The Id.
|
* 作为唯一标识符
|
||||||
*/
|
*/
|
||||||
ResourceLocation ID = Lib39.rl("command_helper");
|
ResourceLocation ID = Lib39.rl("command_helper");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 一定要在构造器方法里调用 {@link #initialize 初始化方法}
|
||||||
* Instantiates a new Lib 39 command help manager.
|
* Instantiates a new Lib 39 command help manager.
|
||||||
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public Lib39CommandHelpManager() {
|
public Lib39CommandHelpManager() {
|
||||||
initialize();
|
initialize();
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,17 @@ import top.r3944realms.lib39.core.command.SimpleHelpCommand;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type Lib 39 help command.
|
* <pre>
|
||||||
|
* 指令注册以及帮助编写类
|
||||||
|
* 这是一个模组内置的示例
|
||||||
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public class Lib39HelpCommand extends SimpleHelpCommand {
|
public class Lib39HelpCommand extends SimpleHelpCommand {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 需要{@link CommandDispatcher<CommandSourceStack> 指令注册调度器} 和 {@link CommandBuildContext 指令上下文}
|
||||||
|
* </pre>
|
||||||
* Instantiates a new Lib 39 help command.
|
* Instantiates a new Lib 39 help command.
|
||||||
*
|
*
|
||||||
* @param dispatcher the dispatcher
|
* @param dispatcher the dispatcher
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The enum Lib 39 lang key.
|
* The enum Lib 39 lang key.
|
||||||
|
|
@ -322,7 +323,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_ROOT.
|
* The constant LIB39_ROOT.
|
||||||
*/
|
*/
|
||||||
// 根命令
|
|
||||||
public static final LangKeyValue LIB39_ROOT = addAndRet(
|
public static final LangKeyValue LIB39_ROOT = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.root", ModPartEnum.MESSAGE,
|
"commands.lib39.root", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -337,7 +337,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_TEST.
|
* The constant LIB39_TEST.
|
||||||
*/
|
*/
|
||||||
// 測試命令
|
|
||||||
public static final LangKeyValue LIB39_TEST = addAndRet(
|
public static final LangKeyValue LIB39_TEST = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.test", ModPartEnum.MESSAGE,
|
"commands.lib39.test", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -408,7 +407,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_GREET_BASIC.
|
* The constant LIB39_GREET_BASIC.
|
||||||
*/
|
*/
|
||||||
// 問候命令
|
|
||||||
public static final LangKeyValue LIB39_GREET_BASIC = addAndRet(
|
public static final LangKeyValue LIB39_GREET_BASIC = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.greet.basic", ModPartEnum.MESSAGE,
|
"commands.lib39.greet.basic", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -465,7 +463,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_CALCULATE.
|
* The constant LIB39_CALCULATE.
|
||||||
*/
|
*/
|
||||||
// 計算命令
|
|
||||||
public static final LangKeyValue LIB39_CALCULATE = addAndRet(
|
public static final LangKeyValue LIB39_CALCULATE = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.calculate", ModPartEnum.MESSAGE,
|
"commands.lib39.calculate", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -494,7 +491,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_TELEPORT.
|
* The constant LIB39_TELEPORT.
|
||||||
*/
|
*/
|
||||||
// 傳送命令
|
|
||||||
public static final LangKeyValue LIB39_TELEPORT = addAndRet(
|
public static final LangKeyValue LIB39_TELEPORT = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.teleport", ModPartEnum.MESSAGE,
|
"commands.lib39.teleport", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -523,7 +519,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_INFO.
|
* The constant LIB39_INFO.
|
||||||
*/
|
*/
|
||||||
// 信息命令
|
|
||||||
public static final LangKeyValue LIB39_INFO = addAndRet(
|
public static final LangKeyValue LIB39_INFO = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.info", ModPartEnum.MESSAGE,
|
"commands.lib39.info", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -580,7 +575,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_TEAM.
|
* The constant LIB39_TEAM.
|
||||||
*/
|
*/
|
||||||
// 隊伍系統
|
|
||||||
public static final LangKeyValue LIB39_TEAM = addAndRet(
|
public static final LangKeyValue LIB39_TEAM = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.team", ModPartEnum.MESSAGE,
|
"commands.lib39.team", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -679,7 +673,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_GAME.
|
* The constant LIB39_GAME.
|
||||||
*/
|
*/
|
||||||
// 遊戲系統
|
|
||||||
public static final LangKeyValue LIB39_GAME = addAndRet(
|
public static final LangKeyValue LIB39_GAME = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.game", ModPartEnum.MESSAGE,
|
"commands.lib39.game", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -806,7 +799,6 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
/**
|
/**
|
||||||
* The constant LIB39_SETTINGS.
|
* The constant LIB39_SETTINGS.
|
||||||
*/
|
*/
|
||||||
// 設置命令
|
|
||||||
public static final LangKeyValue LIB39_SETTINGS = addAndRet(
|
public static final LangKeyValue LIB39_SETTINGS = addAndRet(
|
||||||
LangKeyValue.ofKey(
|
LangKeyValue.ofKey(
|
||||||
"commands.lib39.settings", ModPartEnum.MESSAGE,
|
"commands.lib39.settings", ModPartEnum.MESSAGE,
|
||||||
|
|
@ -861,7 +853,7 @@ public enum Lib39LangKey implements ILangKeyValueCollection {
|
||||||
);
|
);
|
||||||
|
|
||||||
// ===== 添加缺失的導入 =====
|
// ===== 添加缺失的導入 =====
|
||||||
private static final java.util.function.Consumer<LangKeyValue> addConsumer = items::add;
|
private static final Consumer<LangKeyValue> addConsumer = items::add;
|
||||||
|
|
||||||
private static LangKeyValue addAndRet(LangKeyValue item) {
|
private static LangKeyValue addAndRet(LangKeyValue item) {
|
||||||
items.add(item);
|
items.add(item);
|
||||||
|
|
|
||||||
|
|
@ -353,8 +353,8 @@ public class WheelWidget extends AbstractWidget {
|
||||||
*
|
*
|
||||||
* @return the section circle diameter
|
* @return the section circle diameter
|
||||||
*/
|
*/
|
||||||
// 滚轮选择器中每个扇形的圆形直径
|
|
||||||
public float getSectionCircleDiameter() {
|
public float getSectionCircleDiameter() {
|
||||||
|
// 滚轮选择器中每个扇形的圆形直径
|
||||||
return this.ringOuterRadius + this.ringInnerRadius;
|
return this.ringOuterRadius + this.ringInnerRadius;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ public abstract class SimpleHelpCommand implements IHelpCommand {
|
||||||
protected final LiteralArgumentBuilder<CommandSourceStack> root;
|
protected final LiteralArgumentBuilder<CommandSourceStack> root;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* <pre>
|
||||||
|
* 需要{@link CommandDispatcher<CommandSourceStack> 指令注册调度器} 和 {@link CommandBuildContext 指令上下文}
|
||||||
|
* </pre>
|
||||||
* Instantiates a new Simple help command.
|
* Instantiates a new Simple help command.
|
||||||
*
|
*
|
||||||
* @param dispatcher the dispatcher
|
* @param dispatcher the dispatcher
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ loom {
|
||||||
}
|
}
|
||||||
runs {
|
runs {
|
||||||
client {
|
client {
|
||||||
client()
|
|
||||||
client()
|
client()
|
||||||
ideConfigGenerated true
|
ideConfigGenerated true
|
||||||
programArgs '--launch_target', 'net.fabricmc.loader.impl.launch.knot.KnotClient'
|
programArgs '--launch_target', 'net.fabricmc.loader.impl.launch.knot.KnotClient'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# Every field you add must be added to buildSrc/src/main/groovy/multiloader-common.gradle expandProps map.
|
# Every field you add must be added to buildSrc/src/main/groovy/multiloader-common.gradle expandProps map.
|
||||||
|
|
||||||
# Project
|
# Project
|
||||||
version=0.5.0
|
version=0.5.1
|
||||||
group=top.r3944realms.lib39
|
group=top.r3944realms.lib39
|
||||||
java_version=17
|
java_version=17
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user