@@ -12,13 +12,24 @@ ZH-CN / [English](README-EN.md)
1212
1313</div ></center >
1414
15+ ## 模组可用指令
16+
17+ 以` /hardcodepatcher ` 或` /hp ` 为基础,共有3个可用的命令或参数,分别为:` export ` 、` list ` 、` reload ` 。
18+
19+ * ` /hp export ` 会向` .Minecraft ` 根目录输出一个叫` langpacther.json ` 的文件,里面存放的是你已经加载的文本内容(并不代表加载的模组和游戏的全部文本,将鼠标放在模组物品上,这个物品的名字和描述将全部记录)
20+ 该指令与` optimize_params ` 功能有关
21+ * ` /hp list ` 在聊天栏列举加载的` 模块.json ` ,鼠标放在绿色字符串上会显示相关信息
22+ * ` /hp reload ` 重新加载资源包内容
23+
1524# 配置文件
1625
1726## 配置
1827
28+ 在1.2.5以后,配置文件均采用模块的形式
1929在` config/HardcodePatcher/ ` 下的格式为` config.json ` 和若干个` 模块.json ` 。(模块文件目前在Fabric版中是必须存在一个及以上)
2030
21- ` config.json ` 是必须的。
31+ ` config.json ` 是必须的。
32+
2233如下:
2334``` json
2435{
@@ -27,21 +38,28 @@ ZH-CN / [English](README-EN.md)
2738 ],
2839 "debug_mode" : {
2940 "is_enable" : false ,
41+ "test_mode" : false ,
3042 "output_mode" : 0 ,
3143 "output_format" : " <source> -> <target>"
3244 },
3345 "optimize_params" : {
3446 "disable_export" : true ,
47+ "disable_stacks" : true ,
3548 "stack_min" : -1 ,
3649 "stack_max" : -1
3750 }
3851}
3952```
40- ### 模块(mods)(模块文件目前在Fabric版是必须存在一个及以上)
53+ ### 模块(mods)
4154` config.json ` 定义了` 模块.json ` ,
4255` 模块.json ` 才会被正常读取读取并使用。反之亦然。
4356
57+ ### 编辑模式(test_mode,虽然没有编辑功能)
58+
59+ 开启后,模组会把字符串匹配度高达50%的做一个标记,替换的地方会做一个标记
60+
4461### 调试模式(Debug Mode)
62+
4563可以在调试和查找文本时使用。
4664
4765` is_enable ` 决定调试功能是否开启。开启时会在替换字符串时向日志中输出一行调试信息,调试信息的格式由` output_format ` 决定,调试信息的内容由` output_mode ` 决定。
@@ -65,6 +83,9 @@ ZH-CN / [English](README-EN.md)
6583` disable_export ` 决定是否禁用` export ` 功能,该选项对于优化有很大的作用。但同时` /vaultpatcher export ` 也将禁用。
6684默认为 false。
6785
86+ ` disable_stacks ` 决定是否禁用堆栈匹配,该选项对于优化有很大的作用。但同时类匹配也将禁用。
87+ 默认为 false。
88+
6889` stack_min ` 和` stack_max ` ,决定了堆栈跟踪数组中的上限与下限,适当调整参数可以达到优化效果。
6990默认均为 -1(即不更改上限下限)。
7091
@@ -77,7 +98,7 @@ ZH-CN / [English](README-EN.md)
7798 {
7899 "target_class" : {
79100 "name" : " " ,
80- "mapping " : " Intermediaty " ,
101+ "method " : " " ,
81102 "stack_depth" : -1
82103 },
83104 "key" : " I'm key" ,
@@ -86,7 +107,7 @@ ZH-CN / [English](README-EN.md)
86107 {
87108 "target_class" : {
88109 "name" : " me.modid.item.relics" ,
89- "mapping " : " Intermediaty " ,
110+ "method " : " " ,
90111 "stack_depth" : 3
91112 },
92113 "key" : " Dragon Relic" ,
@@ -95,7 +116,7 @@ ZH-CN / [English](README-EN.md)
95116 {
96117 "target_class" : {
97118 "name" : " " ,
98- "mapping " : " Intermediaty " ,
119+ "method " : " " ,
99120 "stack_depth" : 0
100121 },
101122 "key" : " Talents" ,
@@ -127,7 +148,7 @@ ZH-CN / [English](README-EN.md)
127148{
128149 "target_class" : {
129150 "name" : " " ,
130- "mapping " : " Intermediaty " ,
151+ "method " : " " ,
131152 "stack_depth" : -1
132153 },
133154 "key" : " I'm key" ,
@@ -143,19 +164,19 @@ ZH-CN / [English](README-EN.md)
143164` key ` ,顾名思义,指定的是要翻译的字符串。
144165
145166如果我想翻译标题界面的`` Copyright Mojang AB. Do not distribute! `` ,
146- 那么可以指定` "key":"Copyright Mojang AB. Do not distribute! " ` 。
167+ 那么可以指定` "key":"你的翻译内容 " ` 。
147168
148169#### 值(Value)
149170
150171有了键,还得有值。
151172
152- 那么我想将`` Copyright Mojang AB. Do not distribute! `` 改为`` Mojang AB . `` 。
153- 那就可以指定` "value":"Mojang AB ." ` 。
173+ 那么我想将`` Copyright Mojang AB. `` 改为`` Copyright Mojang ABCD .`` 。
174+ 那就可以指定` "value":"Copyright Mojang ABCD ." ` 。
154175
155176#### 半匹配
156177以上的方式均为全匹配(即完全替换),只替换与` key ` 相同的文本。
157178
158- 如果你想半匹配,或者原字符串中有格式化文本 (例如` §a ` 、` %d ` 、` %s ` 等)。
179+ 如果你想半匹配,或者原字符串中有无法进行全匹配的格式化文本 (例如` §a ` 、` %d ` 、` %s ` 等)。
159180那么可以在` value ` 的前面加上` @ ` 字符,实现半匹配。
160181
161182例子:
@@ -175,7 +196,7 @@ ZH-CN / [English](README-EN.md)
175196{
176197 "target_class" : {
177198 "name" : " " ,
178- "mapping " : " Intermediaty " ,
199+ "method " : " " ,
179200 "stack_depth" : 0
180201 },
181202 "key" : " Copyright Mojang AB. Do not distribute!" ,
@@ -196,7 +217,7 @@ ZH-CN / [English](README-EN.md)
196217{
197218 "target_class" : {
198219 "name" : " " ,
199- "mapping " : " Intermediaty " ,
220+ "method " : " " ,
200221 "stack_depth" : -1
201222 },
202223 "key" : " Copyright Mojang AB. Do not distribute!" ,
@@ -224,41 +245,42 @@ ZH-CN / [English](README-EN.md)
224245
225246#### 类匹配
226247
227- * 以` # ` 开头的字符串会视为类匹配(示例:` #TitleScreen ` 会匹配` net.minecraft.client.gui.screen.TitleScreen `
228- 和` net.minecraft.client.gui.screen.titlescreen `
229- 但不匹配` net.minecraft.client.gui.titlescreen.screen ` )
248+ * 以` # ` 开头的字符串会视为类匹配(示例:` #TitleScreen ` 会匹配` net.minecraft.client.gui.screens.TitleScreen `
249+ 和` net.minecraft.client.gui.screens.titlescreen `
250+ 但不匹配` net.minecraft.client.gui.titlescreen.screens ` )
251+ * 实际上是` String.endsWith ` ,即匹配末尾内容
230252
231253#### 包匹配
232254
233- * 以` @ ` 开头的字符串会视为包匹配(示例:` #net.minecraft.client ` 会匹配` net.minecraft.client.gui.screen.TitleScreen `
234- 和` net.minecraft.client.gui.screen.DeathScreen ` 等等
235- 也匹配` net.minecraft.client.gui.titlescreen.screen ` )
255+ * 以` @ ` 开头的字符串会视为包匹配(示例:` #net.minecraft.client ` 会匹配` net.minecraft.client.gui.screens.TitleScreen `
256+ 和` net.minecraft.client.gui.screens.BeaconScreen ` 等等
257+ 也匹配` net.minecraft.client.gui.titlescreen.screens ` )
258+ * 实际上是` String.startsWith ` ,即匹配开头内容
236259
237260#### 完全匹配
238261
239- * 不以` # ` 或` @ ` 开头的字符串会视为全匹配(示例:` net.minecraft.client.gui.screen.TitleScreen ` 会匹配` net.minecraft.client.gui.screen.TitleScreen `
240- 和` net.minecraft.client.gui.screen.titlescreen `
241- 但不匹配` net.minecraft.client.gui.titlescreen.screen ` )
262+ * 不以` # ` 或` @ ` 开头的字符串会视为全匹配(示例:` net.minecraft.client.gui.screens.TitleScreen ` 会匹配` net.minecraft.client.gui.screens.TitleScreen `
263+ 和` net.minecraft.client.gui.screens.titlescreen `
264+ 但不匹配` net.minecraft.client.gui.titlescreen.screens ` )
265+ * 实际上是` String.equals ` ,即匹配文本
242266
243- ### 映射(mapping )
267+ ### 方法(method )
244268
245- 保留字段
269+ 方法在类之中,用于更精准的定位文本内容
246270
247271### 堆栈深度(stack depth)
248272
249- #### ** (Tips: 过于复杂,不建议新手用)**
250- #### ** (作者其实也不会)**
251-
252273堆栈深度在堆栈中用于更精准的匹配类,
253274例如在如下堆栈中
254275
255- ```
276+ ``` txt
256277java.base/java.lang.Thread.getStackTrace(Thread.java:1610),
257- TRANSFORMER/[email protected] /net.minecraft.client.gui.screen.TitleScreen(TitleScreen.java:3), 278+ TRANSFORMER/[email protected] /net.minecraft.network.chat.TextComponent.handler$zza000$proxy_init(TextComponent.java:531), 279+ TRANSFORMER/[email protected] /net.minecraft.client.gui.screens.TitleScreen(TitleScreen.java:3), 258280...
259281```
260282
261- ` net.minecraft.client.gui.screen .TitleScreen ` 的` stack_depth ` 就是2。
283+ ` net.minecraft.client.gui.screens .TitleScreen ` 的` stack_depth ` 就是2。
262284` stack_depth ` 的大小取决于要定位的堆栈所处的位置,
263285使用` stack_depth ` 时,` name ` 不能为模糊匹配。
264286
@@ -267,16 +289,17 @@ TRANSFORMER/
[email protected] /net.minecraft.client.gui.screen.TitleScreen(TitleSc
267289``` json
268290{
269291 "target_class" : {
270- "name" : " net.minecraft.client.gui.screen .TitleScreen" ,
271- "mapping " : " Intermediaty " ,
292+ "name" : " net.minecraft.client.gui.screens .TitleScreen" ,
293+ "method " : " " ,
272294 "stack_depth" : 2
273295 },
274296 "key" : " Copyright Mojang AB. Do not distribute!" ,
275297 "value" : " Mojang AB."
276298}
277299```
278300
279- 此时便能精准的定位到` net.minecraft.client.gui.screen.TitleScreen ` 这个类。
301+ 此时便能精准的定位到` net.minecraft.client.gui.screens.TitleScreen ` 这个类。
302+
280303
281304### 参考配置
282305
@@ -285,47 +308,26 @@ TRANSFORMER/
[email protected] /net.minecraft.client.gui.screen.TitleScreen(TitleSc
285308``` json
286309[
287310 {
288- "target_class" : {
289- "name" : " " ,
290- "mapping" : " Intermediaty" ,
291- "stack_depth" : 0
292- },
293311 "key" : " Attack Damage" ,
294312 "value" : " namespace.modify.the_vault.gui.attackdamage"
295313 },
296314 {
297- "target_class" : {
298- "name" : " " ,
299- "mapping" : " Intermediaty" ,
300- "stack_depth" : 0
301- },
302315 "key" : " Dragon Relic" ,
303316 "value" : " namespace.modify.the_vault.item.relics.dragonrelic"
304317 },
305318 {
306- "target_class" : {
307- "name" : " " ,
308- "mapping" : " Intermediaty" ,
309- "stack_depth" : 0
310- },
311319 "key" : " Talents" ,
312320 "value" : " namespace.modify.the_vault.gui.talnets"
313321 }
314322]
315323```
316324
317- 如果你仔细看的话,那么你会发现,` target_class ` 这个键其实很少被使用。
318-
319325## 其他
320326
321- #### Fabric移植:TexTrue
322-
323- #### 原开发团队:
324-
325- - 作者:[ FengMing] ( https://github.com/3093FengMing )
327+ ** 原作者:FengMing([ github] ( https://github.com/3093FengMing ) ,[ 爱发电] ( https://afdian.net/a/fengming3093 ) )**
326328
327- - 配置部分:[ teddyxlandlee] ( https://github.com/teddyxlandlee )
329+ ** 配置部分:teddyxlandlee( [ github ] ( https://github.com/teddyxlandlee ) ) **
328330
329- - 想法:[ yiqv] ( https://github.com/yiqv )
331+ ** 想法:yiqv( [ github ] ( https://github.com/yiqv ) ) **
330332
331- #### 原Mod地址:[ github ] ( https://github.com/3093FengMing/VaultPatcher )
333+ ** 原Mod地址:[ Modrith ] ( https://modrinth.com/mod/vault-patcher ) , [ Github ] ( https:// github.com/3093FengMing/VaultPatcher) , [ mcmod ] ( https://www.mcmod.cn/class/8765.html ) , [ bilibili ] ( 等 ) **
0 commit comments