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'<\.\.\.>') # "<...>"