diff --git a/Musicreater/__init__.py b/Musicreater/__init__.py index b406933..c3f94c2 100644 --- a/Musicreater/__init__.py +++ b/Musicreater/__init__.py @@ -22,7 +22,7 @@ The Licensor of Musicreater("this project") is Eilles, bgArray. # 若需转载或借鉴 许可声明请查看仓库目录下的 License.md -__version__ = "2.4.2.1" +__version__ = "2.4.2.2" __vername__ = "音符附加信息升级" __author__ = ( ("金羿", "Eilles"), diff --git a/Musicreater/exceptions.py b/Musicreater/exceptions.py index 0285a79..22b294d 100644 --- a/Musicreater/exceptions.py +++ b/Musicreater/exceptions.py @@ -39,7 +39,7 @@ class MidiFormatException(MSCTBaseException): def __init__(self, *args): """音·创库版本的所有MIDI格式错误均继承于此""" - super().__init__("MIDI格式错误", *args) + super().__init__("MIDI 格式错误", *args) class MidiDestroyedError(MSCTBaseException): @@ -47,7 +47,7 @@ class MidiDestroyedError(MSCTBaseException): def __init__(self, *args): """Midi文件损坏""" - super().__init__("MIDI文件损坏:无法读取MIDI文件", *args) + super().__init__("MIDI文件损坏:无法读取 MIDI 文件", *args) # class MidiUnboundError(MSCTBaseException): @@ -87,7 +87,7 @@ class NotDefineTempoError(MidiFormatException): def __init__(self, *args): """没有Tempo设定导致时间无法计算的错误""" - super().__init__("在曲目开始时没有声明Tempo(未指定拍长)", *args) + super().__init__("在曲目开始时没有声明 Tempo(未指定拍长)", *args) class ChannelOverFlowError(MidiFormatException): diff --git a/Musicreater/plugin/__init__.py b/Musicreater/plugin/__init__.py index 20d9ed0..c589bde 100644 --- a/Musicreater/plugin/__init__.py +++ b/Musicreater/plugin/__init__.py @@ -34,6 +34,7 @@ __all__ = [ "AXIS_PARTICULAR_VALUE", "COMPABILITY_VERSION_117", "COMPABILITY_VERSION_119", + "COMPABILITY_VERSION_121", # BDX 函数 "bdx_move", "form_command_block_in_BDX_bytes", @@ -62,6 +63,7 @@ from .mcstructure import ( AXIS_PARTICULAR_VALUE, COMPABILITY_VERSION_119, COMPABILITY_VERSION_117, + COMPABILITY_VERSION_121, command_statevalue, form_note_block_in_NBT_struct, form_repeater_in_NBT_struct, diff --git a/Musicreater/plugin/mcstructure.py b/Musicreater/plugin/mcstructure.py index 7d0c098..83feeb3 100644 --- a/Musicreater/plugin/mcstructure.py +++ b/Musicreater/plugin/mcstructure.py @@ -58,6 +58,10 @@ COMPABILITY_VERSION_117: int = 17879555 """ Minecraft 1.17 兼容版本号 """ +COMPABILITY_VERSION_121: int = 18168865 +""" +Minecraft 1.21 兼容版本号 +""" def command_statevalue(axis_: Literal["x", "y", "z", "X", "Y", "Z"], forward_: bool): @@ -236,7 +240,9 @@ def form_command_block_in_NBT_struct( "SuccessCount": 0, "TickDelay": tickDelay, "TrackOutput": trackOutput, - "Version": 25, + "Version": ( + 25 if compability_version_number <= COMPABILITY_VERSION_119 else 43 + ), "auto": alwaysRun, "conditionMet": False, # 是否已经满足条件 "conditionalMode": condition,