Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions minecraft_data_api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

class ServerDataGetterConfig(Serializable):
list_command: str = 'list'
list_output_regex: re.Pattern = re.compile(r'^There are (?P<amount>\d+) of a max( of)? (?P<limit>\d+) players online:(?P<players>.*)$')
list_output_regex: re.Pattern = re.compile(r'^(?:System chat: )?There are (?P<amount>\d+) of a max( of)? (?P<limit>\d+) players online:(?P<players>.*)$')


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<player>^\w+) has the following entity data: .*$')
data_get_output_regex: re.Pattern = re.compile(r'^(?:System chat: )?(?P<player>\w+) has the following entity data: .*$')


class Config(Serializable):
Expand Down
2 changes: 1 addition & 1 deletion minecraft_data_api/json_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'<\.\.\.>') # "<...>"
Expand Down
Loading