From df37bffeec1214e41a37fd2f7aea1fbd793109ee Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Sun, 11 May 2025 22:00:25 +0800 Subject: [PATCH] [ci skip]docs: update Contributing files --- README.md | 2 +- docs/CONTRIBUTING.md | 28 ++++++++++++++++++++-------- docs/CONTRIBUTING_EN.md | 33 +++++++++++++++++++++++---------- 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 5bcc862..b672ff4 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ dependencies { 当您遇到任何问题时,请向我们提问,我们将尽力解决,但请记得清楚地描述您的问题并提供足够的日志等信息。 ## 贡献代码 -可[查看 Contributing](./docs/CONTRIBUTING.md) +可查看 [Contributing](./docs/CONTRIBUTING.md) ## BStats ![bStats](https://bstats.org/signatures/server-implementation/Luminol.svg "bStats") diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index fbf4fd2..ed1e9a3 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -27,7 +27,7 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的修改分成了两个目录: -- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit` 进行的修改。 +- `luminol-api` - 对 `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API` 进行的修改。 - `luminol-server` - 对 Minecraft 标准服务器原有逻辑进行的修改。 补丁系统是基于 git 的,你可以在这里了解 git 的基本内容: @@ -36,9 +36,21 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的 1. 将你的仓库 clone 到本地; 2. 在你的 IDE 或 终端 内执行 Gradle 的 `applyAllPatches` 任务,如果是在终端内,你可以执行 `./gradlew applyAllPatches`; -3. 进入 仓库根目录下的 `luminol-api` 和 `luminol-server` 文件夹进行修改。 +3. 在执行操作后,仓库根目录下应该存在以下目录对: `luminol-api` 和 `luminol-server` , `folia-api` 和 `folia-server` , 以及 `paper-api` 和 `paper-server`(下文称作 `*-api` 和 `*-server` ); +4. 进入 仓库根目录下的 `*-api` 和 `*-server` 文件夹进行修改。 -顺便一提,仓库根目录下的 `luminol-api` 和 `luminol-server` 并不是正常的 git 仓库: +以下为对上述各个文件夹的简单描述,详细描述可以参考[这里](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md): +1. API部分 + - `luminol-api` :暂无有效文件 + - `folia-api` :对folia-API的修改应当在此文件夹下进行 + - `paper-api` :对paper-API/spigot-API/bukkit-API的修改应该在此文件夹下进行 + +2. Server部分 + - `luminol-server` :对Minecraft原版服务器的修改应当在此文件夹下进行 + - `folia-server` :暂无有效文件 + - `paper-server` :对于非原版的对服务器逻辑的修改应当在此文件夹下进行 + +顺便一提,仓库根目录下的 `*-api` 和 `*-server` 并不是正常的 git 仓库: - 在应用补丁前,基点将会指向未被更改的源码 - 在基点后的每一个提交都是一个补丁 @@ -48,11 +60,11 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的 按照以下步骤增加一个补丁是非常简单的: -1. 对 `luminol-api` 和 `luminol-server` 进行修改; +1. 对 `*-api` 和 `*-server` 进行修改; 2. 使用 git 添加你的修改,比如 `git add .`(不要提交新建的文件的修改); 3. 使用 `git commit -m <提交信息>` 进行提交; -4. 运行 Gradle 任务 `rebuildAllServerPatches` 将你的提交转化为一个补丁; -5. 运行 Gradle 任务 `fixupPaperApiFilePatches` 生成新建文件的补丁文件(注意不要提交); +4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 生成新建文件的补丁文件(注意不要提交); +5. 运行 Gradle 任务 `rebuildAllServerPatches` 将你的提交转化为一个补丁; 6. 将你生成的补丁文件进行推送。 这样做以后,你就可以将你的补丁文件进行 PR 提交。 @@ -65,6 +77,6 @@ Luminol 使用和 Folia 一样的补丁系统,并为了针对不同部分的 2. 使用 `git commit -a --fixup ` 来进行一个更正提交;(不要提交对在luminol新建文件的修改) - 如果你想要更改提交信息,你也可以用 `--squash` 来代替 `--fixup`。 3. 使用 `git rebase -i --autosquash base` 来进行自动变基,你只需要输入 `:q` 来关闭确认页面即可; -4. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁; -5. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在luminol新建文件的补丁(注意不要提交); +4. 运行 Gradle 任务 `fixupPaperApiFilePatches` 来修改已被修改的在luminol新建文件的补丁(注意不要提交); +5. 运行 Gradle 任务 `rebuildAllServerPatches` 来修改已被修改的补丁; 6. 将修改后的补丁 PR 发回储存库。 diff --git a/docs/CONTRIBUTING_EN.md b/docs/CONTRIBUTING_EN.md index a0da9cd..e0576db 100644 --- a/docs/CONTRIBUTING_EN.md +++ b/docs/CONTRIBUTING_EN.md @@ -30,8 +30,8 @@ Before coding, you need these pieces of software / tools as Dev Environment. Luminol uses as the same patching system as Paper, and has been divided into two directories for the purpose of modifying different parts of it: -- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit`. -- `luminol-server` - Modifications to Minecraft Official Server's source logic. +- `luminol-api` - Modifications to `Folia-API` / `Paper-API` / `Spigot-API` / `Bukkit-API`. +- `luminol-server` - Modifications to Minecraft Vanilla Server's source logic. The patching system is based on git, and you can learn about it at here: @@ -39,9 +39,22 @@ If you have forked the main repository, then you should follow the steps below: 1. Clone your repository to local 2. Run Gradle's `applyAllPatches` task in your IDE or terminal (You can run `./gradlew applyAllPatches` directly in terminal.) -3. Enter `luminol-api` and `luminol-server` directory to carry out modifications. +3. After performing the operation, the following directory pairs should exist in the root directory of the warehouse: `luminol-api` and `luminol-server` , `folia-api` and `folia-server` , `paper-api` and `paper-server` (Referred to `*-api` and `*-server` as below) +4. Enter `*-api` and `*-server` directory to carry out modifications. -BTW, `luminol-api` and `luminol-server` and are not normal git repositories. +The following is the simple description of the aforementioned folders, detailed description can be referred to [here](https://github.com/Toffikk/paperweight-examples/blob/18241979c88068d5b061d95ad69c98ecb201c246/README.md): + +1. API part + - `luminol-api` : There is no valid file + - `folia-api` : Modifications to Folia API should be carried out in this folder + - `paper-api` : Modifications to Paper API/Spigot API/Bukkit API should be carried out in this folder + +2. Server part + - `luminol-server` : Modifications to Minecraft Vanilla Server's source logic should be carried out in this folder + - `folia-server` : There is no valid file + - `paper-server` : Modifications to non-vanilla server logic should be carried out in this folder + +BTW, `*-api` and `*-server` and are not normal git repositories. - Before applying patches, the base will point to unmodified source code. - Every commit after the base is a patch. @@ -51,11 +64,11 @@ BTW, `luminol-api` and `luminol-server` and are not normal git repositories. It's very easy to add patches by following the steps below: -1. Modify the code of `luminol-api` and `luminol-server` +1. Modify the code of `*-api` and `*-server` 2. Add these changes to the local git repository (For example, `git add .`) 3. Commit these changes using `git commit -m ` (PS: do not commit new-created files) -4. Run Gradle's task `rebuildAllServerPatches` to convert your commits to a new patch -5. Run Gradle's task `fixupPaperApiFilePatches` to generate newly created files to new patches (PS: do not commit again before you run this task) +4. Run Gradle's task `fixupPaperApiFilePatches` to generate newly created files to new patches (PS: do not commit again before you run this task) +5. Run Gradle's task `rebuildAllServerPatches` to convert your commits to a new patch 6. Push your patches to your repository After pushing, you can open a PR to submit your patches. @@ -66,8 +79,8 @@ You can modify an existing patch by following the steps below: 1. Modify code at HEAD 2. Run `git commit -a --fixup ` in your terminal to make a fix-up commit (PS: do not commit changes of luminol-created files) - - If you want to edit the commit message, replace `--fixup` with `--squash`. + - If you want to edit the commit message, replace `--fixup` with `--squash` 3. Run `git rebase -i --autosquash base` to rebase automatically, then just type `:q` to close the confirm page -4. Run Gradle's task `rebuildAllServerPatches` to modify existing patches -5. Run Gradle's task `fixupPaperApiFilePatches` to regenerate luminol-created files to patches (PS: do not commit again before you run this task) +4. Run Gradle's task `fixupPaperApiFilePatches` to regenerate luminol-created files to patches (PS: do not commit again before you run this task) +5. Run Gradle's task `rebuildAllServerPatches` to modify existing patches 6. Push and PR again