diff --git a/Tools.py b/Tools.py index c7d952d..5a13f3f 100644 --- a/Tools.py +++ b/Tools.py @@ -1,12 +1,18 @@ -from tools import addItme, addBlock, outJson, mathParticles +import sys +from tools import addItme, addBlock, outJson, mathParticles, pack tip = '''1.新增物品 2.新增方块 3.生成粒子特效 4.生成MCMOD可导入的JSON +5.导出数据包 0.退出\n''' -if __name__ == '__main__': + +argv = sys.argv + + +def dowhile(): while True: choose = input(tip) if choose == '0': @@ -19,7 +25,26 @@ mathParticles.mathParticles() elif choose == '4': outJson.outJson() + elif choose == '5': + pack.pack() else: pass +if __name__ == '__main__': + try: + get = argv[1] + if get == 'pack': + pack.pack() + elif get == 'additem': + addItme.addItem() + elif get == 'addblock': + addBlock.addblock() + elif get == 'outjson': + outJson.outJson() + elif get == 'mathparticles': + mathParticles.mathParticles() + else: + dowhile() + except: + dowhile() diff --git a/assets/anc/lang/en_us.json b/assets/anc/lang/en_us.json index de7b987..edb09bf 100644 --- a/assets/anc/lang/en_us.json +++ b/assets/anc/lang/en_us.json @@ -1,5 +1,5 @@ { - "Please install the correct resource pack": "§f§l============================§r\n§b§lWelcome to use AnvilCraft,Datapack Version:§r%s§b§l,Resourcepack Version:§6§l0.5.4-pre4§r\n§b§lDatapack author:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§lResourcepack author:§r§6§lXe_Kr§r\n§f§l============================§r", + "Please install the correct resource pack": "§f§l============================§r\n§b§lWelcome to use AnvilCraft,Datapack Version:§r%s§b§l,Resourcepack Version:§6§l0.5.4§r\n§b§lDatapack author:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§lResourcepack author:§r§6§lXe_Kr§r\n§f§l============================§r", "anc.block.magnet_block.name": "Magnet Block", "anc.block.magnet_block.lore": "When activated by redstone, it can suck up the anvil directly below it (within 4 blocks)", "anc.item.empty_protocol.name": "Empty Protocol", diff --git a/assets/anc/lang/zh_cn.json b/assets/anc/lang/zh_cn.json index d3df1eb..6f06061 100644 --- a/assets/anc/lang/zh_cn.json +++ b/assets/anc/lang/zh_cn.json @@ -1,5 +1,5 @@ { - "Please install the correct resource pack": "§f§l============================§r\n§b§l欢迎使用铁砧工艺,数据包版本:§r%s§b§l,资源包版本:§6§l0.5.4-pre4§r\n§b§l数据包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l资源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", + "Please install the correct resource pack": "§f§l============================§r\n§b§l欢迎使用铁砧工艺,数据包版本:§r%s§b§l,资源包版本:§6§l0.5.4§r\n§b§l数据包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l资源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", "anc.block.magnet_block.name": "磁铁", "anc.block.magnet_block.lore": "被红石激活时可以吸起其正下方(4个方块内)的铁砧", "anc.block.crafting_machine.name": "合成器", diff --git a/assets/anc/lang/zh_hk.json b/assets/anc/lang/zh_hk.json index aab795c..8d6196d 100644 --- a/assets/anc/lang/zh_hk.json +++ b/assets/anc/lang/zh_hk.json @@ -1,5 +1,5 @@ { - "Please install the correct resource pack": "§f§l============================§r\n§b§l歡迎使用鐵砧工藝,資料包版本:§r%s§b§l,資源包版本:§6§l0.5.4-pre4§r\n§b§l資料包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l資源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", + "Please install the correct resource pack": "§f§l============================§r\n§b§l歡迎使用鐵砧工藝,資料包版本:§r%s§b§l,資源包版本:§6§l0.5.4§r\n§b§l資料包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l資源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", "anc.block.magnet_block.name": "磁鐵", "anc.block.magnet_block.lore": "被紅石啟動時可以吸起其正下方(4個方塊內)的鐵砧", "anc.item.empty_protocol.name": "空協定", diff --git a/assets/anc/lang/zh_tw.json b/assets/anc/lang/zh_tw.json index aab795c..8d6196d 100644 --- a/assets/anc/lang/zh_tw.json +++ b/assets/anc/lang/zh_tw.json @@ -1,5 +1,5 @@ { - "Please install the correct resource pack": "§f§l============================§r\n§b§l歡迎使用鐵砧工藝,資料包版本:§r%s§b§l,資源包版本:§6§l0.5.4-pre4§r\n§b§l資料包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l資源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", + "Please install the correct resource pack": "§f§l============================§r\n§b§l歡迎使用鐵砧工藝,資料包版本:§r%s§b§l,資源包版本:§6§l0.5.4§r\n§b§l資料包作者:§r§6§lGu_ZT§r§b§l、§r§6§lsch246§r §b§l資源包作者:§r§6§lXe_Kr§r\n§f§l============================§r", "anc.block.magnet_block.name": "磁鐵", "anc.block.magnet_block.lore": "被紅石啟動時可以吸起其正下方(4個方塊內)的鐵砧", "anc.item.empty_protocol.name": "空協定", diff --git a/config.ini b/config.ini index afbaee3..4e606a2 100644 --- a/config.ini +++ b/config.ini @@ -3,6 +3,8 @@ namespace=anc addfile=Add.xls mpf_dir=mpf cmd_prefix=1114 +pack_name=AnvilCraft-{version}-{mcv}.zip +mcv=1.18 [addfile] item=Item diff --git a/data/anc/functions/handle/join.mcfunction b/data/anc/functions/handle/join.mcfunction index 05000e9..9729f96 100644 --- a/data/anc/functions/handle/join.mcfunction +++ b/data/anc/functions/handle/join.mcfunction @@ -1 +1 @@ -tellraw @s {"translate": "Please install the correct resource pack","with":[{"text": "0.5.4-pre4","color": "gold","bold": true}]} +tellraw @s {"translate": "Please install the correct resource pack","with":[{"text": "0.5.4","color": "gold","bold": true}]} diff --git a/data/anc_me/functions/tick.mcfunction b/data/anc_me/functions/tick.mcfunction index a12bf35..1d3c76d 100644 --- a/data/anc_me/functions/tick.mcfunction +++ b/data/anc_me/functions/tick.mcfunction @@ -1,7 +1,7 @@ # 玩家tick execute as @a at @s run function anc_me:tick/player # 引雷2 -execute as @e[type=trident] at @s if data entity @s Trident.tag.Enchantments.[{id:"minecraft:channeling",lvl:2}] run function anc_me:channeling_2 +execute as @e[type=trident] at @s if data entity @s Trident.tag.Enchantments.[{id:"minecraft:channeling",lvl:2s}] run function anc_me:channeling_2 # 以箭为执行者 function anc_me:arrow/type # execute as @e[type=!#anc:not_kill] run function anc_me:tick/mob diff --git a/pack.mcmeta b/pack.mcmeta index a1a382d..b03c0d4 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -7,7 +7,7 @@ "color": "gold" }, { - "text": " v0.5.4-pre4", + "text": " v0.5.4", "color": "gold" }, { diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5d3e0a5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +xlrd~=2.0.1 +opencv-python~=4.5.4.60 +numpy~=1.21.4 +imageio~=2.13.3 +matplotlib~=3.5.0 +zipfile39~=0.0.4.2 diff --git a/tools/pack.py b/tools/pack.py new file mode 100644 index 0000000..45dcbe7 --- /dev/null +++ b/tools/pack.py @@ -0,0 +1,36 @@ +import json +import os.path +from . import pro_dir +from .lib import readConfig +import zipfile + + +def pack(): + pack_mcmeta = os.path.join(pro_dir, 'pack.mcmeta') + pmm = json.loads(open(pack_mcmeta, 'r+', encoding='utf-8').read()) + version = pmm['pack']['description'][1]['text'] + version = version[2:] + name = readConfig.getConfig('settings', 'pack_name').format(version=version, mcv=readConfig.getConfig('settings', 'mcv')) + + data = os.path.join(pro_dir, 'data') + assets = os.path.join(pro_dir, 'assets') + pack_png = os.path.join(pro_dir, 'pack.png') + license_f = os.path.join(pro_dir, 'LICENSE') + + z = zipfile.ZipFile(name, 'w') + z.write(pack_png, "pack.png") + z.write(pack_mcmeta, 'pack.mcmeta') + z.write(license_f, 'LICENSE') + pre_len = len(os.path.dirname(data)) + for parent, dirnames, filenames in os.walk(data): + for filename in filenames: + pathfile = os.path.join(parent, filename) + arcname = pathfile[pre_len:].strip(os.path.sep) # 相对路径 + z.write(pathfile, arcname) + pre_len = len(os.path.dirname(assets)) + for parent, dirnames, filenames in os.walk(assets): + for filename in filenames: + pathfile = os.path.join(parent, filename) + arcname = pathfile[pre_len:].strip(os.path.sep) # 相对路径 + z.write(pathfile, arcname) + z.close() diff --git "a/\347\211\210\346\234\254\350\256\260\345\275\225.md" "b/\347\211\210\346\234\254\350\256\260\345\275\225.md" index 07a8911..a890555 100644 --- "a/\347\211\210\346\234\254\350\256\260\345\275\225.md" +++ "b/\347\211\210\346\234\254\350\256\260\345\275\225.md" @@ -248,7 +248,7 @@ * ANC-000056 v0.5.4-pre3 五毒散无论如何都会有中毒效果 * ANC-000057 v0.5.4-pre3 引雷II失效 -## 2022/02/xx 0.5.4 +## 2022/02/15 0.5.4 * Changes * 磁铁可以吸起掉落中的铁砧了 * 将磁铁可以吸起掉落中的铁砧设置为可配置的 @@ -263,6 +263,7 @@ * 更好的发射器可以用来挤牛奶和繁殖动物了 * Fixed Bugs * ANC-000048 4个海洋之果才能砸出1个海洋之核 + * ANC-000049 批量合成海洋之刃时海晶碎片优先合成海晶石 * ANC-000050 分解与辊压配方均失效 * ANC-000051 煎五毒散未生效 * ANC-000052 v0.5.3 被qc激活的活塞推出的铁砧无法正常掉落 @@ -273,3 +274,4 @@ * ANC-000056 v0.5.4-pre3 五毒散无论如何都会有中毒效果 * ANC-000057 v0.5.4-pre3 引雷II失效 * ANC-000058 v0.5.4-pre4 汤圆合成数量与介绍不同 + * ANC-000059 v0.5.4-pre4 引雷Ⅱ失效