2021-11-21 00:59:15 +08:00
|
|
|
|
"""音·创 的转换工具库"""
|
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
# 诸葛亮与八卦阵帮忙修改语法 日期:---2022年1月19日
|
|
|
|
|
# 统计:致命(三级)错误:0个;警告(二级)错误:4个--未解决1个;语法(一级)错误:302个
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
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
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def hans2pinyin(hans, style=3):
|
2021-11-21 00:59:15 +08:00
|
|
|
|
"""将汉字字符串转化为拼音字符串"""
|
|
|
|
|
from pypinyin import lazy_pinyin
|
2022-01-19 13:32:53 +08:00
|
|
|
|
result = lazy_pinyin(hans=hans, style=style)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
final = ''
|
|
|
|
|
for i in result:
|
2022-01-15 00:40:17 +08:00
|
|
|
|
final += i
|
2021-11-21 00:59:15 +08:00
|
|
|
|
return final
|
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def formCmdBlock(direction: list, command: str, particularValue: int, impluse: int, condition: bool = False,
|
|
|
|
|
needRedstone: bool = True, tickDelay: int = 0, customName: str = '', lastOutput: str = '',
|
|
|
|
|
executeOnFirstTick: bool = False, trackOutput: bool = True):
|
2021-11-21 00:59:15 +08:00
|
|
|
|
"""
|
|
|
|
|
使用指定项目返回指定的指令方块格式字典
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:param trackOutput:
|
|
|
|
|
:param executeOnFirstTick:
|
|
|
|
|
:param lastOutput:
|
|
|
|
|
:param customName:
|
|
|
|
|
:param tickDelay:
|
|
|
|
|
:param needRedstone:
|
|
|
|
|
:param condition:
|
|
|
|
|
:param impluse:
|
|
|
|
|
:param particularValue:
|
|
|
|
|
:param command:
|
|
|
|
|
:param direction:
|
|
|
|
|
|
|
|
|
|
:return: 指令方块字典结构
|
|
|
|
|
"""
|
|
|
|
|
"""
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param block: {
|
|
|
|
|
"direction": [x: int, y: int, z: int] #方块位置
|
|
|
|
|
"block_name": str, #方块名称(无需指定,默认为command_block)
|
|
|
|
|
"particular_value": int, #方块特殊值
|
2022-01-19 13:32:53 +08:00
|
|
|
|
"impluse": int, #方块类型0脉冲 1循环 2连锁 unsigned_int32
|
2021-11-21 00:59:15 +08:00
|
|
|
|
"command": str, #指令
|
|
|
|
|
"customName": str, #悬浮字
|
|
|
|
|
"lastOutput": str, #上次输出
|
|
|
|
|
"tickdelay": int, #方块延时 int32
|
|
|
|
|
"executeOnFirstTick": int, #执行第一个选项 1 bytes
|
|
|
|
|
"trackOutput": int, #是否输出 1 bytes
|
|
|
|
|
"conditional": int, #是否有条件 1 bytes
|
|
|
|
|
"needRedstone": int #是否需要红石 1 bytes
|
|
|
|
|
}
|
|
|
|
|
"""
|
|
|
|
|
return {"direction": direction,
|
|
|
|
|
"block_name": "command_block",
|
|
|
|
|
"particular_value": particularValue,
|
|
|
|
|
"impluse": impluse,
|
|
|
|
|
"command": command,
|
|
|
|
|
"customName": customName,
|
|
|
|
|
"lastOutput": lastOutput,
|
|
|
|
|
"tickdelay": tickDelay,
|
|
|
|
|
"executeOnFirstTick": executeOnFirstTick,
|
|
|
|
|
"trackOutput": trackOutput,
|
|
|
|
|
"conditional": condition,
|
|
|
|
|
"needRedstone": needRedstone
|
2022-01-19 13:32:53 +08:00
|
|
|
|
}
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def note2bdx(filePath: str, dire: list, Notes: list, ScoreboardName: str, Instrument: str, PlayerSelect: str = '',
|
|
|
|
|
isProsess: bool = False, height: int = 200):
|
|
|
|
|
"""使用方法同Note2Cmd
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param 参数说明:
|
|
|
|
|
filePath: 生成.bdx文件的位置
|
|
|
|
|
dire: 指令方块在地图中生成的起始位置(相对位置)
|
2022-01-19 13:32:53 +08:00
|
|
|
|
Notes: 以 list[ list[ float我的世界playsound指令音调 , float延续时常(单位s) ] ] 格式存储的音符列表
|
|
|
|
|
例如Musicreater.py的(dataset[0]['musics'][NowMusic]['notes'])
|
2021-11-21 00:59:15 +08:00
|
|
|
|
ScoreboardName: 用于执行的计分板名称
|
|
|
|
|
Instrument: 播放的乐器
|
|
|
|
|
PlayerSelect: 执行的玩家选择器
|
|
|
|
|
isProsess: 是否显示进度条(会很卡)
|
2021-11-24 13:46:45 +08:00
|
|
|
|
height: 生成结构的最高高度
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:return 返回一个BdxConverter类(实际上没研究过),同时在指定位置生成.bdx文件"""
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
from msctspt.transfer import formCmdBlock
|
|
|
|
|
from nmcsup.trans import Note2Cmd
|
|
|
|
|
from msctspt.bdxOpera_CP import BdxConverter
|
2022-01-19 13:32:53 +08:00
|
|
|
|
cmd = Note2Cmd(Notes, ScoreboardName, Instrument, PlayerSelect, isProsess)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
cdl = []
|
|
|
|
|
for i in cmd:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = True
|
2021-11-21 00:59:15 +08:00
|
|
|
|
try:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
if (i[:i.index('#')].replace(' ', '') != '\n') and (i[:i.index('#')].replace(' ', '') != ''):
|
2021-11-21 00:59:15 +08:00
|
|
|
|
cdl.append(i[:i.index('#')])
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = False
|
|
|
|
|
except ValueError:
|
2021-11-21 00:59:15 +08:00
|
|
|
|
cdl.append(i)
|
2022-01-19 13:32:53 +08:00
|
|
|
|
finally:
|
|
|
|
|
if e is True:
|
|
|
|
|
cdl.append(i)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
i = 0
|
|
|
|
|
down = False
|
2022-01-19 13:32:53 +08:00
|
|
|
|
blocks = [formCmdBlock(dire, cdl.pop(0), 1, 1)]
|
|
|
|
|
dire[1] += 1
|
2021-11-21 00:59:15 +08:00
|
|
|
|
for j in cdl:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
if dire[1] + i > height:
|
|
|
|
|
dire[0] += 1
|
|
|
|
|
i = 0
|
2021-11-21 00:59:15 +08:00
|
|
|
|
down = not down
|
2022-01-19 13:32:53 +08:00
|
|
|
|
if dire[1] + i == height:
|
|
|
|
|
blocks.append(formCmdBlock([dire[0], dire[1] + i, dire[2]], j, 5, 2, False, False))
|
2021-11-21 00:59:15 +08:00
|
|
|
|
else:
|
|
|
|
|
if down:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
blocks.append(formCmdBlock([dire[0], dire[1] + i, dire[2]], j, 0, 2, False, False))
|
2021-11-21 00:59:15 +08:00
|
|
|
|
else:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
blocks.append(formCmdBlock([dire[0], dire[1] + i, dire[2]], j, 1, 2, False, False))
|
|
|
|
|
i += 1
|
2021-11-21 00:59:15 +08:00
|
|
|
|
del i, cdl, down, cmd
|
2022-01-19 13:32:53 +08:00
|
|
|
|
return BdxConverter(filePath, 'Build by RyounMusicreater', blocks)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def note2webs(Notes: list, Instrument: str, speed: float = 5.0, PlayerSelect: str = '', isProsess: bool = False):
|
|
|
|
|
"""传入音符,在oaclhost:8080上建立websocket服务器以供我的世界connect/wssever指令连接
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param 参数说明:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
Notes: 以 list[ list[ float我的世界playsound指令音调 , float延续时常(单位s) ] ] 格式存储的音符列表
|
|
|
|
|
例如Musicreater.py的(dataset[0]['musics'][NowMusic]['notes'])
|
2021-11-21 00:59:15 +08:00
|
|
|
|
Instrument: 播放的乐器
|
|
|
|
|
speed: 用于控制播放速度,数值越大,播放速度越快,相当于把一秒变为几拍
|
|
|
|
|
PlayerSelect: 执行的玩家选择器
|
|
|
|
|
isProsess: 是否显示进度条
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:return None"""
|
|
|
|
|
|
2021-11-21 00:59:15 +08:00
|
|
|
|
import time
|
|
|
|
|
import fcwslib
|
|
|
|
|
import asyncio
|
|
|
|
|
from nmcsup.log import log
|
|
|
|
|
from nmcsup.vers import VER
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
async def run_server(websocket): # , path
|
2021-11-21 00:59:15 +08:00
|
|
|
|
log('服务器连接创建')
|
2022-01-19 13:32:53 +08:00
|
|
|
|
await fcwslib.tellraw(websocket, '已连接服务器——音·创' + VER[1] + VER[0] + ' 作者:金羿(W-YI)')
|
|
|
|
|
length = len(Notes)
|
|
|
|
|
j = 1
|
2021-11-21 00:59:15 +08:00
|
|
|
|
if isProsess:
|
|
|
|
|
length = len(Notes)
|
2022-01-15 00:40:17 +08:00
|
|
|
|
j = 1
|
2021-11-21 00:59:15 +08:00
|
|
|
|
for i in range(len(Notes)):
|
2022-01-19 13:32:53 +08:00
|
|
|
|
await fcwslib.send_command(websocket,
|
2022-01-25 15:08:38 +08:00
|
|
|
|
f'execute @a{PlayerSelect} ~ ~ ~ playsound {Instrument} @s ~ ~ ~ 1000 {Notes[i][0]} 1000')
|
2021-11-21 00:59:15 +08:00
|
|
|
|
if isProsess:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
fcwslib.send_command(websocket,
|
|
|
|
|
'execute @a' + PlayerSelect + ' ~ ~ ~ title @s actionbar §e▶ 播放中: §a' + str(
|
|
|
|
|
j) + '/' + str(length) + ' || ' + str(int(j / length * 1000) / 10))
|
|
|
|
|
j += 1
|
|
|
|
|
time.sleep(Notes[i][1] / speed)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
|
|
|
|
fcwslib.run_server(run_server)
|
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def note2RSworld(world: str, startpos: list, notes: list, instrument: str, speed: float = 2.5,
|
|
|
|
|
posadder: list = [1, 0, 0], baseblock: str = 'stone'): # -> bool
|
|
|
|
|
"""传入音符,生成以音符盒存储的红石音乐
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param 参数说明:
|
|
|
|
|
world: 地图文件的路径
|
|
|
|
|
startpos: list[int,int,int] 开始生成的坐标
|
2022-01-19 13:32:53 +08:00
|
|
|
|
notes: list[list[float,float]] 以 list[ list[ float我的世界playsound指令音调 , float延续时常(单位s) ] ]
|
|
|
|
|
格式存储的音符列表 例如Musicreater.py的dataset[0]['musics'][NowMusic]['notes']
|
2021-11-21 00:59:15 +08:00
|
|
|
|
instrument: 播放的乐器
|
|
|
|
|
speed: 一拍占多少个中继器延迟(红石刻/rt)
|
|
|
|
|
posadder: list[int,int,int] 坐标增加规律,即红石的延长时按照此增加规律增加坐标
|
|
|
|
|
baseblock: 在中继器下垫着啥方块呢~
|
|
|
|
|
:return 是否生成成功
|
2022-01-19 13:32:53 +08:00
|
|
|
|
"""
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
from msctspt.values import height2note, instuments
|
2021-11-21 00:59:15 +08:00
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def formNoteBlock(note: int, instrument1: str = 'note.harp', powered: bool = False):
|
|
|
|
|
"""生成音符盒方块
|
|
|
|
|
:param powered:
|
|
|
|
|
:param instrument1:
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param note: 0~24
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:return Block()"""
|
2021-11-21 00:59:15 +08:00
|
|
|
|
if powered:
|
2022-01-15 00:40:17 +08:00
|
|
|
|
powered = 'true'
|
2021-11-21 00:59:15 +08:00
|
|
|
|
else:
|
2022-01-15 00:40:17 +08:00
|
|
|
|
powered = 'false'
|
2022-01-19 13:32:53 +08:00
|
|
|
|
return Block('universal_minecraft', 'noteblock',
|
|
|
|
|
{"instrument": ts(instrument1.replace("note.", '')), 'note': ts(str(note)),
|
|
|
|
|
'powered': ts(powered)})
|
|
|
|
|
|
|
|
|
|
def formRepeater(delay: int, facing: str, locked: bool = False, powered: bool = False):
|
|
|
|
|
"""生成中继器方块
|
|
|
|
|
:param powered:
|
|
|
|
|
:param locked:
|
|
|
|
|
:param facing:
|
2021-11-21 00:59:15 +08:00
|
|
|
|
:param delay: 1~4
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:return Block()"""
|
|
|
|
|
if powered:
|
|
|
|
|
powered = 'true'
|
|
|
|
|
else:
|
|
|
|
|
powered = 'false'
|
|
|
|
|
if locked:
|
|
|
|
|
locked = 'true'
|
|
|
|
|
else:
|
|
|
|
|
locked = 'false'
|
|
|
|
|
return Block('universal_minecraft', 'repeater',
|
|
|
|
|
{"delay": ts(str(delay)), 'facing': ts(facing), 'locked': ts(locked), 'powered': ts(powered)})
|
|
|
|
|
|
2021-11-21 00:59:15 +08:00
|
|
|
|
level = amulet.load_level(world)
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def setblock(block: Block, pos: list):
|
|
|
|
|
"""pos : list[int,int,int]"""
|
2021-11-21 00:59:15 +08:00
|
|
|
|
cx, cz = bc2cc(pos[0], pos[2])
|
|
|
|
|
chunk = level.get_chunk(cx, cz, "minecraft:overworld")
|
|
|
|
|
offset_x, offset_z = pos[0] - 16 * cx, pos[2] - 16 * cz
|
|
|
|
|
chunk.blocks[offset_x, pos[1], offset_z] = level.block_palette.get_add_block(block)
|
|
|
|
|
chunk.changed = True
|
|
|
|
|
|
|
|
|
|
# 1拍 x 2.5 rt
|
|
|
|
|
def placeNoteBlock():
|
|
|
|
|
for i in notes:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
error = True
|
|
|
|
|
try:
|
|
|
|
|
setblock(formNoteBlock(height2note[i[0]], instrument), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
setblock(Block("universal_minecraft", instuments[i[0]][1]), startpos)
|
|
|
|
|
error = False
|
|
|
|
|
except ValueError:
|
|
|
|
|
log("无法放置音符:" + str(i) + '于' + str(startpos))
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), startpos)
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
finally:
|
|
|
|
|
if error is True:
|
|
|
|
|
log("无法放置音符:" + str(i) + '于' + str(startpos))
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), startpos)
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
delay = int(i[1] * speed + 0.5)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
if delay <= 4:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
startpos[0] += 1
|
|
|
|
|
setblock(formRepeater(delay, 'west'), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), startpos)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
else:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
for j in range(int(delay / 4)):
|
|
|
|
|
startpos[0] += 1
|
|
|
|
|
setblock(formRepeater(4, 'west'), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), startpos)
|
2021-11-21 00:59:15 +08:00
|
|
|
|
if delay % 4 != 0:
|
2022-01-19 13:32:53 +08:00
|
|
|
|
startpos[0] += 1
|
|
|
|
|
setblock(formRepeater(delay % 4, 'west'), [startpos[0], startpos[1] + 1, startpos[2]])
|
|
|
|
|
setblock(Block("universal_minecraft", baseblock), startpos)
|
|
|
|
|
startpos[0] += posadder[0]
|
|
|
|
|
startpos[1] += posadder[1]
|
|
|
|
|
startpos[2] += posadder[2]
|
|
|
|
|
|
|
|
|
|
e = True
|
2021-11-21 00:59:15 +08:00
|
|
|
|
try:
|
|
|
|
|
placeNoteBlock()
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = False
|
|
|
|
|
except ValueError:
|
2021-11-21 00:59:15 +08:00
|
|
|
|
log("无法放置方块了,可能是因为区块未加载叭")
|
2022-01-19 13:32:53 +08:00
|
|
|
|
finally:
|
|
|
|
|
if e:
|
|
|
|
|
log("无法放置方块了,可能是因为区块未加载叭")
|
2021-11-21 00:59:15 +08:00
|
|
|
|
level.save()
|
|
|
|
|
level.close()
|
2021-11-21 17:44:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ryStruct:
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def __init__(self, world: str) -> None:
|
2021-11-22 13:13:43 +08:00
|
|
|
|
|
2021-11-21 17:44:35 +08:00
|
|
|
|
self.RyStruct = dict()
|
2021-11-22 13:13:43 +08:00
|
|
|
|
self._world = world
|
|
|
|
|
self._level = amulet.load_level(world)
|
|
|
|
|
|
|
|
|
|
def reloadLevel(self):
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = True
|
2021-11-22 13:13:43 +08:00
|
|
|
|
try:
|
|
|
|
|
self._level = amulet.load_level(self.world)
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = False
|
|
|
|
|
except ValueError:
|
2021-11-22 13:13:43 +08:00
|
|
|
|
log("无法重载地图")
|
2022-01-19 13:32:53 +08:00
|
|
|
|
finally:
|
|
|
|
|
if e:
|
|
|
|
|
log("无法重载地图")
|
2021-11-22 13:13:43 +08:00
|
|
|
|
|
|
|
|
|
def closeLevel(self):
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = True
|
2021-11-22 13:13:43 +08:00
|
|
|
|
try:
|
|
|
|
|
self._level.close()
|
2022-01-19 13:32:53 +08:00
|
|
|
|
e = False
|
|
|
|
|
except ValueError:
|
2021-11-22 13:13:43 +08:00
|
|
|
|
log("无法关闭地图")
|
2022-01-19 13:32:53 +08:00
|
|
|
|
finally:
|
|
|
|
|
if e:
|
|
|
|
|
log("无法重载地图")
|
2021-11-21 17:44:35 +08:00
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
def world2Rys(self, startp: list, endp: list, includeAir: bool = False):
|
|
|
|
|
"""将世界转换为RyStruct字典,注意,此函数运行成功后将关闭地图,若要打开需要运行 reloadLevel
|
2021-11-22 13:13:43 +08:00
|
|
|
|
:param startp: [x,y,z] 转化的起始坐标
|
|
|
|
|
:param endp : [x,y,z] 转换的终止坐标,注意,终止坐标需要大于起始坐标,且最终结果包含终止坐标
|
|
|
|
|
:param includeAir : bool = False 是否包含空气,即空气是否在生成之时覆盖地图内容
|
2022-01-19 13:32:53 +08:00
|
|
|
|
:return dict RyStruct """
|
2021-11-21 17:44:35 +08:00
|
|
|
|
|
2021-11-22 13:13:43 +08:00
|
|
|
|
level = self._level
|
2022-01-19 13:32:53 +08:00
|
|
|
|
|
|
|
|
|
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):
|
2021-11-21 17:44:35 +08:00
|
|
|
|
|
|
|
|
|
RyStructBlock = dict()
|
|
|
|
|
|
2021-11-22 13:13:43 +08:00
|
|
|
|
cx, cz = bc2cc(x, z)
|
2021-11-21 17:44:35 +08:00
|
|
|
|
chunk = level.get_chunk(cx, cz, "minecraft:overworld")
|
|
|
|
|
universal_block = chunk.block_palette[chunk.blocks[x - 16 * cx, y, z - 16 * cz]]
|
2022-01-19 13:32:53 +08:00
|
|
|
|
if universal_block == Block("universal_minecraft", "air") and includeAir:
|
2021-11-21 17:44:35 +08:00
|
|
|
|
continue
|
|
|
|
|
universal_block_entity = chunk.block_entities.get((x, y, z), None)
|
2022-01-19 13:32:53 +08:00
|
|
|
|
|
2021-11-21 17:44:35 +08:00
|
|
|
|
RyStructBlock["block"] = str(universal_block)
|
|
|
|
|
RyStructBlock["blockEntity"] = str(universal_block_entity)
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
log("载入方块数据" + str(RyStructBlock))
|
|
|
|
|
|
|
|
|
|
self.RyStruct[(x, y, z)] = RyStructBlock
|
2021-11-22 13:13:43 +08:00
|
|
|
|
|
|
|
|
|
level.close()
|
2021-11-21 17:44:35 +08:00
|
|
|
|
|
|
|
|
|
return self.RyStruct
|
|
|
|
|
|
|
|
|
|
|
2022-01-19 13:32:53 +08:00
|
|
|
|
"""
|
2021-11-21 17:44:35 +08:00
|
|
|
|
RyStruct = {
|
|
|
|
|
(0,0,0) = {
|
|
|
|
|
"block": str 完整的方块结构
|
|
|
|
|
"blockEntity": str | 'None'
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-01-19 13:32:53 +08:00
|
|
|
|
"""
|