Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit cbd448a

Browse files
committed
1.6 Snapshot
1 parent 6fec534 commit cbd448a

File tree

5 files changed

+83
-81
lines changed

5 files changed

+83
-81
lines changed

ExeGenerator.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pip install pyinstaller
2+
pyinstaller --onefile sc_to_rsc.py
3+
pause

main.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

sc_to_rsc.exe

-118 KB
Binary file not shown.

sc_to_rsc.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from sys import stdout
77
from time import time
88

9-
VERSION = "1.5-RELEASE"
9+
VERSION = "1.6-SNAPSHOT"
1010

1111

1212
class Color:
@@ -53,10 +53,10 @@ def getYamlContext(file):
5353
return {}
5454
return result
5555
except FileNotFoundError:
56-
error(f'文件 {file} 未找到')
56+
error(f'File {file} not found.')
5757
return {}
5858
except PermissionError:
59-
error(f'无权限打开文件 {file}')
59+
error(f'Permission denied: {file}')
6060
return {}
6161

6262

@@ -571,14 +571,11 @@ def readConfig():
571571
'full-copy-slimecustomizer'
572572
)
573573
if config.lores.full_copy_slimecustomizer:
574-
print(f'''
575-
{Color.cyan} 您已开启完全复制 SlimeCustomizer.
576-
在修改您的配置的时候请注意 lore 是否需要修改!
577-
''')
574+
print(f'''{Color.cyan} You have already enabled full-copy-slimecustomizer.''')
578575
hexColorForm = {
579576
"vanilla": "&#{}{}{}{}{}{}",
580577
"vanilla2": "&x&{}&{}&{}&{}&{}&{}",
581-
"cmi": "#{}{}{}{}{}{}", # 外大括号另外设置,不在这里
578+
"cmi": "#{}{}{}{}{}{}",
582579
"minimessage": "<#{}{}{}{}{}{}>",
583580
"minedown": "&#{}{}{}{}{}{}&"
584581
}[config.colorMode]
@@ -607,6 +604,7 @@ def readConfig():
607604
config.info.name = info['name']
608605
config.info.depends = info['depends']
609606
config.info.pluginDepends = info['pluginDepends']
607+
config.info.scriptListener = info['scriptListener']
610608
config.info.version = info['version']
611609
config.info.description = info['description']
612610
config.info.authors = info['authors']
@@ -658,7 +656,8 @@ def generateBase():
658656
"armors.yml",
659657
"recipe_types.yml",
660658
"foods.yml",
661-
"supers.yml"
659+
"supers.yml",
660+
"template_machines.yml"
662661
)
663662
for file_name in files:
664663
with open(getPath(file_name), 'w', encoding='utf-8') as f:
@@ -677,6 +676,7 @@ def translateInfo():
677676
'name': config.info.name,
678677
'depends': config.info.depends,
679678
'pluginDepends': config.info.pluginDepends,
679+
'scriptListener': config.info.scriptListener,
680680
'version': config.info.version,
681681
'description': config.info.description,
682682
'authors': config.info.authors,
@@ -688,6 +688,7 @@ def translateInfo():
688688
'name': "Unknown addon",
689689
'depends': [],
690690
'pluginDepends': [],
691+
'scriptListener': "",
691692
'version': "1.0 SNAPSHOT",
692693
'description': 'No description',
693694
'authors': [""],
@@ -1332,7 +1333,7 @@ def createFile(file_name, text=''):
13321333
CAPA_SKULL = '91361e576b493cbfdfae328661cedd1add55fab4e5eb418b92cebf6275f8bb4'
13331334
CHARS = {'n': '__', 'm': '~~', 'k': '??', 'l': '**', 'o': '##'}
13341335
CHARS2 = {'l': '<l>', 'n': '<u>', 'o': '<i>', 'k': '<obf>', 'm': '<st>'}
1335-
NULL = '__SC_TO_RSC_NOT_FOUND_ARG'
1336+
NULL = '__SC_TO_RSC_NOT_FOUND_ARGUMENT'
13361337
BACKGROUND_READER = "background-slots"
13371338
INPUT_READER = "input-slots"
13381339
OUTPUT_READER = "output-slots"
@@ -1414,16 +1415,15 @@ def main():
14141415
else:
14151416
createFile(create_args)
14161417
generateMenus()
1417-
print(f'{Color.cyan}\n作为作者,我并不能保证转换出来的文本一定能够使用,因为结果会受到各种因素的影响')
1418-
print(f'{Color.cyan}包括但不限于,原配置错误,规则不一致等。')
1418+
print(f'{Color.cyan}\nAs the author, I cannot guarantee that the translated text will be used, because the result will be affected by various factors.')
1419+
print(f'{Color.cyan}Including but not limited to, the original configuration error, inconsistency, etc.')
14191420
print(f"{Color.green}Done! {time()-start}")
14201421
else:
1421-
error('未找到配置文件 translate_config.yml. 请从github补全文件再运行本程序!')
1422+
error('Cannot find translate_config.yml. Please complete the file from github and run the program again!')
14221423
finally:
1423-
error(f'\n{Color.red}如遇无法转换,可能是配置不完整,如确认配置文件无误请提issue!')
1424-
error(f'{Color.red}记得修改 info.yml 以避免出现附属重名')
1425-
input(f"{Color.cyan}按任意键退出...{Color.red}")
1426-
1424+
error(f'\n{Color.red}If you encounter any problems, please submit an issue on the github repository.')
1425+
error(f'{Color.red}Don\'t forget to change the id in info.yml before release.')
1426+
input(f"{Color.cyan}Press any key to exit...{Color.red}")
14271427

14281428
if __name__ == '__main__':
14291429
main()

translate_config.yml

Lines changed: 63 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,129 @@
1-
# 不要删除已有的参数的名字!
2-
3-
# 转换后输出到哪个文件夹
4-
outputFolder: "translated"
1+
# The folder to output
2+
outputFolder: "out"
53

4+
# The handling method for colors
65
colorMode: cmi
76
# vanilla: &#RRGGBB
87
# vanilla2: &x&R&R&G&G&B&B
98
# cmi: {#RRGGBB}
109
# minimessage: <#RRGGBB>
1110
# minedown: &#RRGGBB&
1211

13-
# 物品组处理方式
12+
# The handling method for item groups
1413
groupMode: none
15-
# 示例: item_group: example
14+
# Example: item_group: example
1615
# prefix: item_group: rsc_example
1716
# namespace: item_group: rykenslimecustomizer:example
1817
# none: item_group: example
1918

20-
# 设置输出的所有保存物品的版本号
19+
# Change the version of all the saveditems
2120
setAllSaveditems_v: none
22-
# none: 不做修改
23-
# 数字: 改为对应数字
24-
# 示例: setAllSaveditems_v: 2975
21+
# none: Not to change
22+
# Number: Change the version to the number
23+
# Example: setAllSaveditems_v: 2975
2524

26-
# 是否启用自动创建版本化物品
25+
# Auto create versioned object (Unsafe)
2726
enableCreateVersionedObject: false
2827

2928
menus:
3029
sections:
31-
#########################################
32-
# -------------预设参数-------------
33-
# 已有参数的名字不可修改!
34-
B: gray_stained_glass_pane # 背景
35-
I: blue_stained_glass_pane # 输入槽背景
36-
O: orange_stained_glass_pane # 输出槽背景
37-
N: continue # 跳过当前槽
38-
P: progress # 进度条
39-
i: input # 输入槽位
40-
o: output # 输出槽位
41-
# -------------预设参数-------------
42-
#########################################
30+
##########################################################
31+
# -------------------Preset Parameters-------------------
32+
# Don't change the following parameters
33+
B: gray_stained_glass_pane # Default background
34+
I: blue_stained_glass_pane # Default input background
35+
O: orange_stained_glass_pane # Default output background
36+
N: continue # Continue the slot
37+
P: progress # The progress bar slot
38+
i: input # The empty slot for input
39+
o: output # The empty slot for output
40+
# -------------------Preset Parameters-------------------
41+
##########################################################
4342

44-
# 可自定义其他的,不要与上面的重复
45-
# 详见 rsc-wiki.通用物品格式
43+
# Define other sections here
44+
# See https://rsc.hiworldmc.com/#/format/universal-item-format
4645
# a:
4746
# name: '&a'
4847
# material_type: mc
4948
# material: BEDROCK
50-
# modelId: 114514
49+
# modelId: 123456789
5150
# glow: false
5251
# lore:
53-
# - 第1行
54-
# - 第114514行
52+
# - The first line
53+
# - The second line
5554
# b: this_is_a_mc_item
5655
# c:
5756
# material_type: skull_hash
5857
# material: this_is_skull_hash
59-
n: # 占位符
58+
n: # Placeholder
6059
material_type: none
6160

62-
# 机器菜单
61+
# Machines' menu
6362
machines:
64-
title: "%name%" # %name% 自动转为机器名称
65-
background-slots: # 非 io 都会被读取
63+
title: "%name%" # %name% will be replaced by the machine's name
64+
background-slots: # Except for 'i' and 'o', all slots will be read
6665
- "BBBBBBBBB"
6766
- "IIIIBOOOO"
6867
- "IiiIPOooO"
6968
- "IIIIBOOOO"
7069
- "BBBBBBBBB"
71-
input-slots: # i 会被读取
70+
input-slots: # Only i will be read
7271
- "BBBBBBBBB"
7372
- "IIIIBOOOO"
7473
- "IiiIPOooO"
7574
- "IIIIBOOOO"
7675
- "BBBBBBBBB"
77-
output-slots: # o 会被读取
76+
output-slots: # Only o will be read
7877
- "BBBBBBBBB"
7978
- "IIIIBOOOO"
8079
- "IiiIPOooO"
8180
- "IIIIBOOOO"
8281
- "BBBBBBBBB"
83-
# 发电机菜单
82+
# Generators' menu
8483
generators:
85-
title: "%name%" # %name% 自动转为发电机名称
86-
background-slots: # 非 io 都会被读取
84+
title: "%name%" # %name% will be replaced by the generator's name
85+
background-slots: # Except for 'i' and 'o', all slots will be read
8786
- "BBBBBBBBB"
8887
- "IIIIBOOOO"
8988
- "IiiIPOooO"
9089
- "IIIIBOOOO"
9190
- "BBBBBBBBB"
92-
input-slots: # i 会被读取
91+
input-slots: # Only i will be read
9392
- "BBBBBBBBB"
9493
- "IIIIBOOOO"
9594
- "IiiIPOooO"
9695
- "IIIIBOOOO"
9796
- "BBBBBBBBB"
98-
output-slots: # o 会被读取
97+
output-slots: # Only o will be read
9998
- "BBBBBBBBB"
10099
- "IIIIBOOOO"
101100
- "IiiIPOooO"
102101
- "IIIIBOOOO"
103102
- "BBBBBBBBB"
104-
# 材料生成器菜单
103+
# Material generators' menu
105104
material-generators:
106-
title: "%name%" # %name% 自动转为材料生成器名称
107-
background-slots: # 非 io 都会被读取
105+
title: "%name%" # %name% will be replaced by the material generator's name
106+
background-slots: # Except for 'i' and 'o', all slots will be read
108107
- "Poooooooo"
109-
output-slots: # o 会被读取
108+
output-slots: # Only o will be read
110109
- "Poooooooo"
111110

112111
lores:
113-
# 是否完全复制 SlimeCutomizer 的 lore 的格式
112+
# Full copy SlimeCustomizer lores
114113
full-copy-slimecustomizer: true
115-
additions: # 附加参数
116-
categories: {} # 分类
114+
additions: # Addition config
115+
categories: {} # Categories
117116
#categories:
118-
#group1: # 分组1
119-
# items: # 适用物品,不存在会跳过
117+
#group1: # Group1
118+
# items: # Which item to select to add config
120119
# - '__example_item'
121-
# - '__all__' # 全部内容,不建议使用
122-
# config: # 配置内容
120+
# - '__all__' # All the items
121+
# config: # Content of the config
123122
# register:
124123
# conditions:
125124
# - "version >= 1.16"
126-
#groups2: {} # 分组2,自定名字
127-
mob_drops: {} # 生物掉落。同上格式
125+
#groups2: {} # Group2, Name it by yourself
126+
mob_drops: {} # Mob drops, similar to categories
128127
geo_resources: {}
129128
items: {}
130129
capacitors: {}
@@ -150,24 +149,27 @@ additions: # 附加参数
150149
researches: {}
151150

152151
info:
153-
# 是否使用此设置(false时自动读取sc-addon.yml
152+
# Enable or disable the addon (When false, it will read sc-addon.yml)
154153
enable: false
155-
# 附属在RSC内的附属id
154+
# The id of the addon in RykenSlimeCustomizer
156155
id: RSC_SlimefunExpansion
157-
# 附属名字
156+
# The name of the addon
158157
name: Unknown addon
159-
# 后置插件
158+
# The addon depends which based on RykenSlimeCustomizer
160159
depends: []
161-
# 硬前置插件(通常不会自动加载)
160+
# The plugin depends which based on Slimefun (Usually won't auto load)
162161
pluginDepends:
163162
- Slimefun
164163
#- GuizhanLibPlugin
165-
# 附属版本
164+
# The version of the addon
166165
version: 1.0 SNAPSHOT
167-
# 附属介绍
166+
# The description of the addon
168167
description: No description
169-
# 附属作者
168+
# The authors of the addon
170169
authors:
171170
- ''
172-
# 附属仓库
171+
# The github repository of the addon
173172
repo: ''
173+
174+
# Don't change this
175+
config-version: 1.6-SNAPSHOT

0 commit comments

Comments
 (0)