From 47255899a41ead863179ff6ec4e4e0e60e84b60d Mon Sep 17 00:00:00 2001 From: Crystal0404 <120556221+Crystal0404@users.noreply.github.com> Date: Wed, 23 Sep 2026 23:41:16 +0800 Subject: [PATCH] 26.3 fix --- minecraft_data_api/config.py | 4 ++-- minecraft_data_api/json_parser.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/minecraft_data_api/config.py b/minecraft_data_api/config.py index 2750a49..5bd3594 100644 --- a/minecraft_data_api/config.py +++ b/minecraft_data_api/config.py @@ -5,13 +5,13 @@ class ServerDataGetterConfig(Serializable): list_command: str = 'list' - list_output_regex: re.Pattern = re.compile(r'^There are (?P\d+) of a max( of)? (?P\d+) players online:(?P.*)$') + list_output_regex: re.Pattern = re.compile(r'^(?:System chat: )?There are (?P\d+) of a max( of)? (?P\d+) players online:(?P.*)$') class PlayerDataGetterConfig(Serializable): data_get_all_command: str = 'data get entity {player}' data_get_path_command: str = 'data get entity {player} {path}' - data_get_output_regex: re.Pattern = re.compile(r'^(?P^\w+) has the following entity data: .*$') + data_get_output_regex: re.Pattern = re.compile(r'^(?:System chat: )?(?P\w+) has the following entity data: .*$') class Config(Serializable): diff --git a/minecraft_data_api/json_parser.py b/minecraft_data_api/json_parser.py index a45d3bf..6f8b1c8 100644 --- a/minecraft_data_api/json_parser.py +++ b/minecraft_data_api/json_parser.py @@ -6,7 +6,7 @@ class MinecraftJsonParser: - __COMMAND_RESULT_PREFIX_REGEX = re.compile(r'^[^ ]* has the following entity data: ') + __COMMAND_RESULT_PREFIX_REGEX = re.compile(r'^(System chat: )?[^ ]* has the following entity data: ') __LETTER_AFTER_NUMBER_REGEX = re.compile(r'(([{\[:,]|^) *[+-]?\d+(\.\d*?)?(E[+-]?\d+)?)([bsLdf])') __ARRAY_HEADER_REGEX = re.compile(r'(?<=\[)[IL];') # "I;" or "L;" after a "[" __FOLDED_TAG_REGEX = re.compile(r'<\.\.\.>') # "<...>"