mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2025-03-03 20:34:22 +08:00
no bug fixed
This commit is contained in:
parent
c78a537573
commit
d3343ddd51
@ -227,31 +227,33 @@ def __main__():
|
||||
SaveProject()
|
||||
log("程序正常退出")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
try:
|
||||
global dataset
|
||||
del dataset
|
||||
global root
|
||||
root.destroy()
|
||||
del root
|
||||
except:
|
||||
pass;
|
||||
|
||||
global root
|
||||
root.destroy()
|
||||
del root
|
||||
|
||||
|
||||
if clearLog :
|
||||
print("清除log(此句不载入日志)")
|
||||
try:
|
||||
shutil.rmtree("./log/")
|
||||
if os.path.exists("./log/"):
|
||||
shutil.rmtree("./log/")
|
||||
if os.path.exists("./logs/"):
|
||||
shutil.rmtree("./logs/")
|
||||
if os.path.exists("./cache/"):
|
||||
shutil.rmtree("./cache/")
|
||||
except:
|
||||
pass;
|
||||
try:
|
||||
shutil.rmtree("./logs/")
|
||||
except:
|
||||
pass;
|
||||
try:
|
||||
shutil.rmtree("./cache/")
|
||||
except:
|
||||
pass;
|
||||
print("无法清除日志及临时文件")
|
||||
|
||||
|
||||
exit()
|
||||
@ -924,14 +926,15 @@ def __main__():
|
||||
log("取消")
|
||||
return;
|
||||
from msctspt.transfer import ryStruct
|
||||
rys = ryStruct()
|
||||
rys.World2Rys(outdir,begp,endp,isAir)
|
||||
rys = ryStruct(outdir)
|
||||
rys.world2Rys(begp,endp,isAir)
|
||||
try:
|
||||
with open(fileName,'w',encoding='utf-8') as f:
|
||||
json.dump(rys.RyStruct,f,sort_keys=True, indent=4, separators=(', ', ': '), ensure_ascii=False)
|
||||
tkinter.messagebox.showinfo("成功✔",'文件已生成\n'+fileName)
|
||||
except:
|
||||
tkinter.messagebox.showerror("失败❌",'文件无法生成\n'+fileName+'\n'+str(rys.RyStruct))
|
||||
rys.closeLevel()
|
||||
|
||||
|
||||
|
||||
@ -1033,10 +1036,10 @@ def __main__():
|
||||
|
||||
# 刷新主要部分
|
||||
def RefreshMain():
|
||||
LabelPackName['text'] = '包名: '+dataset[0]['mainset']['PackName']
|
||||
LabelMusicTitle['text'] = '音乐标题: '+dataset[0]['mainset']['MusicTitle']
|
||||
LabelPackName['text'] = '包名: '+str(dataset[0]['mainset']['PackName'])
|
||||
LabelMusicTitle['text'] = '音乐标题: '+str(dataset[0]['mainset']['MusicTitle'])
|
||||
LabelIsRepeat['text'] = '是否重复: '+str(dataset[0]['mainset']['IsRepeat'])
|
||||
LabelPlayerSelect['text'] = '玩家选择器:'+dataset[0]['mainset']['PlayerSelect']
|
||||
LabelPlayerSelect['text'] = '玩家选择器:'+str(dataset[0]['mainset']['PlayerSelect'])
|
||||
MusicList_var.set(()) # 为列表框设置新值
|
||||
for i in range(len(dataset[0]['musics'])):
|
||||
ListMusicList.insert(tk.END, i)
|
||||
@ -1384,7 +1387,7 @@ def __main__():
|
||||
|
||||
# 进入窗口消息循环
|
||||
root.mainloop()
|
||||
|
||||
log("退出")
|
||||
del filemenu, editmenu, helpmenu
|
||||
|
||||
exitapp()
|
||||
|
12
README.md
12
README.md
@ -1,6 +1,6 @@
|
||||
# Musicreater
|
||||
|
||||
#### 介绍
|
||||
### 介绍
|
||||
音·创(Musicreater)是由金羿(W-YI)开发的一款《我的世界》基岩版音乐生成辅助软件
|
||||
|
||||
欢迎加群:861684859
|
||||
@ -8,7 +8,7 @@
|
||||
### 软件架构
|
||||
|
||||
软件采用Python作为第一语言,目前还没有使用其他语言辅助。现在的图形库是tkinter,后期将使用BeeWare兼容安卓
|
||||
现阶段支持Windows7+,Linux(版本嘛,支持Python3就好)
|
||||
现阶段支持Windows7+,Linux(版本嘛,支持Python3.8就好)
|
||||
|
||||
|
||||
### 安装教程
|
||||
@ -19,7 +19,7 @@
|
||||
1. 安装Python 3.8.10
|
||||
[下载64位安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10-amd64.exe)
|
||||
[下载32位安装包](https://www.python.org/ftp/python/3.8.10/python-3.8.10.exe)
|
||||
2. 以管理员身份运行 补全库.py
|
||||
2. 以管理员身份运行 补全库.py :
|
||||
- 按下 Ctrl+Shift+Esc 打开任务管理器
|
||||
- 点击 "文件" 菜单中的 运行新任务 命令
|
||||
- 输入 `cmd` 并框选 "以管理员身份运行" 按下 "确定"
|
||||
@ -47,9 +47,9 @@ python3 Musicreater.py
|
||||
|
||||
### 使用说明
|
||||
|
||||
1. 别急,还没写
|
||||
2. xxxx
|
||||
3. xxxx
|
||||
1. 直接运行就好
|
||||
2. 看得懂简体中文字的不一定全会用
|
||||
3. 最好要懂一点点英文
|
||||
|
||||
### 致谢
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -101,7 +101,7 @@ class version:
|
||||
libraries = ('mido','amulet','amulet-core','amulet-nbt','piano_transcription_inference','pypinyin','briefcase','toga','pyinstaller','kivy','py7zr')
|
||||
'''当前所需库,有一些是开发用的,用户不需要安装'''
|
||||
|
||||
version = ('0.0.4.1','Beta',)
|
||||
version = ('0.0.4.2','Beta',)
|
||||
'''当前版本'''
|
||||
|
||||
def __init__(self) -> None:
|
||||
|
@ -137,6 +137,13 @@ def note2webs(Notes : list,Instrument:str, speed:float = 5.0, PlayerSelect:str='
|
||||
|
||||
|
||||
|
||||
import amulet
|
||||
from amulet.api.block import Block
|
||||
from amulet.utils.world_utils import block_coords_to_chunk_coords as bc2cc
|
||||
from amulet_nbt import TAG_String as ts
|
||||
from nmcsup.log import log
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -152,13 +159,10 @@ def note2RSworld(world:str,startpos:list,notes:list,instrument:str,speed:float =
|
||||
baseblock: 在中继器下垫着啥方块呢~
|
||||
:return 是否生成成功
|
||||
'''
|
||||
import amulet
|
||||
from amulet.api.block import Block
|
||||
from amulet.utils.world_utils import block_coords_to_chunk_coords as bc2cc
|
||||
from amulet_nbt import TAG_String as ts
|
||||
|
||||
|
||||
from msctspt.values import height2note,instuments
|
||||
from nmcsup.log import log
|
||||
|
||||
|
||||
def formNoteBlock(note:int,instrument:str='note.harp',powered:bool = False):
|
||||
'''生成音符盒方块
|
||||
@ -235,26 +239,45 @@ def note2RSworld(world:str,startpos:list,notes:list,instrument:str,speed:float =
|
||||
|
||||
class ryStruct:
|
||||
|
||||
def __init__(self) -> None:
|
||||
def __init__(self,world:str) -> None:
|
||||
|
||||
|
||||
self.RyStruct = dict()
|
||||
|
||||
def World2Rys(self,world:str,startp:list,endp:list,includeAir:bool=False):
|
||||
|
||||
import amulet
|
||||
import amulet_nbt
|
||||
from amulet.api.block import Block
|
||||
from amulet.utils.world_utils import block_coords_to_chunk_coords
|
||||
|
||||
level = amulet.load_level(world)
|
||||
self._world = world
|
||||
self._level = amulet.load_level(world)
|
||||
|
||||
|
||||
for x in range(startp[0],endp[0]):
|
||||
for y in range(startp[1],endp[1]):
|
||||
for z in range(startp[2],endp[2]):
|
||||
def reloadLevel(self):
|
||||
try:
|
||||
self._level = amulet.load_level(self.world)
|
||||
except:
|
||||
log("无法重载地图")
|
||||
|
||||
def closeLevel(self):
|
||||
try:
|
||||
self._level.close()
|
||||
except:
|
||||
log("无法关闭地图")
|
||||
|
||||
|
||||
def world2Rys(self,startp:list,endp:list,includeAir:bool=False):
|
||||
'''将世界转换为RyStruct字典,注意,此函数运行成功后将关闭地图,若要打开需要运行 reloadLevel
|
||||
:param startp: [x,y,z] 转化的起始坐标
|
||||
:param endp : [x,y,z] 转换的终止坐标,注意,终止坐标需要大于起始坐标,且最终结果包含终止坐标
|
||||
:param includeAir : bool = False 是否包含空气,即空气是否在生成之时覆盖地图内容
|
||||
:return dict RyStruct '''
|
||||
|
||||
|
||||
level = self._level
|
||||
|
||||
|
||||
for x in range(startp[0],endp[0]+1):
|
||||
for y in range(startp[1],endp[1]+1):
|
||||
for z in range(startp[2],endp[2]+1):
|
||||
|
||||
RyStructBlock = dict()
|
||||
|
||||
cx, cz = block_coords_to_chunk_coords(x, z)
|
||||
cx, cz = bc2cc(x, z)
|
||||
chunk = level.get_chunk(cx, cz, "minecraft:overworld")
|
||||
universal_block = chunk.block_palette[chunk.blocks[x - 16 * cx, y, z - 16 * cz]]
|
||||
if universal_block == Block("universal_minecraft","air") and includeAir:
|
||||
@ -264,8 +287,11 @@ class ryStruct:
|
||||
RyStructBlock["block"] = str(universal_block)
|
||||
RyStructBlock["blockEntity"] = str(universal_block_entity)
|
||||
|
||||
log("载入方块数据"+str(RyStructBlock))
|
||||
|
||||
self.RyStruct[(x,y,z)] = RyStructBlock
|
||||
|
||||
level.close()
|
||||
|
||||
return self.RyStruct
|
||||
|
||||
|
@ -1 +1 @@
|
||||
MANIFEST-000077
|
||||
MANIFEST-000089
|
||||
|
Binary file not shown.
BIN
测试用/CanyonTest/db/MANIFEST-000089
Normal file
BIN
测试用/CanyonTest/db/MANIFEST-000089
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user