Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packer/字体修复/杂项更新 #3288

Merged
merged 18 commits into from
Nov 25, 2023
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# CFPA-specifics
Minecraft-Mod-Language-Package-*.zip
*.md5
Packer.exe
Packer.xml


## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down Expand Up @@ -370,4 +377,4 @@ clrcompression.dll
clrjit.dll
coreclr.dll
mscordaccore.dll
/src/Packer/Properties/launchSettings.json
/src/Packer/Properties/launchSettings.json
5 changes: 4 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ projects 文件夹下只标出的大版本号,其中的模组翻译文件应

### Packer

路径:[./config/packer.json](./config/packer.json)
路径:`./config/packer/[version].json`(如1.12的文件在[1.12.2.json](./config/packer/1.12.2.json)

该文件内放置了**所有**正在维护的版本的打包配置。
不要随意*删去*内容,除非你知道它为什么弃用。
Expand All @@ -204,6 +204,9 @@ projects 文件夹下只标出的大版本号,其中的模组翻译文件应

- 增加新翻译版本
- 需要将所有项填写一遍,同时需要更新`.github/workflows/packer.yml`、`.github/workflows/pr-packer.yml`、`.github\boring-cyborg.yml`,以及 [CFPABot](https://github.com/Cyl18/CFPABot) 等相关服务。没有规划最好不要乱动。
- 更改字符替换表
- 修改`replacementMap`,格式与已有文本一致。Unicode*基础多语种平面(BMP)*以外的字符需要使用**UTF-16代理对**输入,否则可能无法识别。
- 同时可能需要修改字体文件。
- 处理非文本文件
1. 如果该文件所在的文件夹与`lang`文件夹同级,且对**任何模组都**不会有文本文件(如font\),将该文件夹加入对应版本的`noProcessNamespace`中。
2. 否则,将该模组的`CurseForge 项目名称`或`命名空间`中的一个(具体选哪一个看具体情况)加入`modNameBlackList`或`domainBlackList`,并将**所有**受影响的文件的相对位置加入`additionalContents`。
Expand Down
7 changes: 5 additions & 2 deletions Packer-Index-Doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

本仓库的打包器支持对不同模组使用不同的**检索策略**。
## 注意事项
- 检索策略仅对**文本文件**有效;**非文本文件**无法通过默认的检索途径,需要在`config/packer.json`中设置绕过检索。详见[此处](./CONTRIBUTING.md#configpackerjson)。
- 检索策略目前不支持递归调用;所有对于其余位置的引用都不会读取引用位置的`packer-policy.json`。
- 检索策略仅对**未配置为跳过处理**的文件有正常行为。在`clonemissing`和`backport`下,目前而言,**跳过处理的文件**均优先取**既有文件**;在`patch`下,目前**并不**支持对**跳过处理的文件**添加修改包。
- 既有的全局配置中,在`font/`和`textures/`下的文件全部**跳过处理**,即便是文本文件。
- 关于全局配置中的跳过选项,详见[此处](./CONTRIBUTING.md#packer)。
- 目前而言,`patch`策略还不支持递归调用。`noaction`显然没有递归之忧。对于其他选项,打包器支持**递归调用**:对其他目录的引用可以包含其中的`packer-policy.json`;打包器可以在该目录建立新的**自定义检索策略**。
- 如果遇到**循环引用**,打包器可能不会自动中止,而是持续运行,直到*栈溢出*;应当尽量避免这一情况的发生。

## 策略配置

Expand Down
15 changes: 0 additions & 15 deletions config/fontmap.txt

This file was deleted.

128 changes: 0 additions & 128 deletions config/packer.json

This file was deleted.

40 changes: 40 additions & 0 deletions config/packer/1.12.2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"targetVersion": "1.12.2",
"targetLanguage": [
"zh_cn"
],
"additionalContent": [
"LICENSE",
"pack.mcmeta",
"pack.png",
"README.txt"
],
"modNameBlackList": [
"gregtechce"
],
"domainBlackList": [
"srparasites"
],
"noProcessNamespace": [
"font",
"textures"
],
"replacementMap": {
"[[钅卢]]": "\ue900",
"[[钅杜]]": "\ue901",
"[[钅喜]]": "\ue902",
"[[钅波]]": "\ue903",
"[[钅黑]]": "\ue904",
"[[钅麦]]": "\u9fcf",
"[[钅达]]": "\ue906",
"[[钅仑]]": "\ue907",
"[[钅哥]]": "\u9fd4",
"[[钅尔]]": "\u9fed",
"[[钅夫]]": "\ue90a",
"[[钅立]]": "\ue90c",
"[[石田]]": "\u9fec",
"[[奥气]]": "\u9feb",
"[[气奥]]": "\u9feb",
"……": "\u22ef\u22ef"
}
}
37 changes: 37 additions & 0 deletions config/packer/1.16-fabric.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"targetVersion": "1.16-fabric",
"targetLanguage": [
"zh_cn"
],
"additionalContent": [
"LICENSE",
"pack.mcmeta",
"pack.png",
"README.txt"
],
"modNameBlackList": [],
"domainBlackList": [],
"noProcessNamespace": [
"font",
"textures"
],
"replacementMap": {
"[[钅卢]]": "\ud872\udf3b",
"[[钅杜]]": "\ud872\udf4a",
"[[钅喜]]": "\ud872\udf73",
"[[钅波]]": "\ud872\udf5b",
"[[钅黑]]": "\ud872\udf76",
"[[钅麦]]": "\u9fcf",
"[[钅达]]": "\ud86d\udffc",
"[[钅仑]]": "\ud872\udf2d",
"[[钅哥]]": "\u9fd4",
"[[钅尔]]": "\u9fed",
"[[钅夫]]": "\ud86d\udce7",
"[[钅立]]": "\ud86d\udff7",
"[[石田]]": "\u9fec",
"[[奥气]]": "\u9feb",
"[[气奥]]": "\u9feb",
"……": "\u22ef\u22ef",
"——": "\u2e3a"
}
}
38 changes: 38 additions & 0 deletions config/packer/1.16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"targetVersion": "1.16",
"targetLanguage": [
"zh_cn"
],
"additionalContent": [
"LICENSE",
"pack.mcmeta",
"pack.png",
"README.txt",
"assets/alexs-mobs/alexsmobs/lang/en_us.json"
],
"modNameBlackList": [],
"domainBlackList": [],
"noProcessNamespace": [
"font",
"textures"
],
"replacementMap": {
"[[钅卢]]": "\ud872\udf3b",
"[[钅杜]]": "\ud872\udf4a",
"[[钅喜]]": "\ud872\udf73",
"[[钅波]]": "\ud872\udf5b",
"[[钅黑]]": "\ud872\udf76",
"[[钅麦]]": "\u9fcf",
"[[钅达]]": "\ud86d\udffc",
"[[钅仑]]": "\ud872\udf2d",
"[[钅哥]]": "\u9fd4",
"[[钅尔]]": "\u9fed",
"[[钅夫]]": "\ud86d\udce7",
"[[钅立]]": "\ud86d\udff7",
"[[石田]]": "\u9fec",
"[[奥气]]": "\u9feb",
"[[气奥]]": "\u9feb",
"……": "\u22ef\u22ef",
"——": "\u2e3a"
}
}
39 changes: 39 additions & 0 deletions config/packer/1.18-fabric.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"targetVersion": "1.18-fabric",
"targetLanguage": [
"zh_cn"
],
"additionalContent": [
"LICENSE",
"pack.mcmeta",
"pack.png",
"README.txt"
],
"modNameBlackList": [],
"domainBlackList": [
"litematica"
],
"noProcessNamespace": [
"font",
"textures"
],
"replacementMap": {
"[[钅卢]]": "\ud872\udf3b",
"[[钅杜]]": "\ud872\udf4a",
"[[钅喜]]": "\ud872\udf73",
"[[钅波]]": "\ud872\udf5b",
"[[钅黑]]": "\ud872\udf76",
"[[钅麦]]": "\u9fcf",
"[[钅达]]": "\ud86d\udffc",
"[[钅仑]]": "\ud872\udf2d",
"[[钅哥]]": "\u9fd4",
"[[钅尔]]": "\u9fed",
"[[钅夫]]": "\ud86d\udce7",
"[[钅立]]": "\ud86d\udff7",
"[[石田]]": "\u9fec",
"[[奥气]]": "\u9feb",
"[[气奥]]": "\u9feb",
"……": "\u22ef\u22ef",
"——": "\u2e3a"
}
}
Loading
Loading