From 25bf7eccd3a7a23d4cef75719a4f94f42b3923a9 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Fri, 5 Nov 2021 18:47:09 +0800 Subject: [PATCH] v1.2.2 fixed extra `"` in dimension string with rcon on --- here/entry.py | 4 ++-- mcdreforged.plugin.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/here/entry.py b/here/entry.py index 81f51e4..4800fa6 100644 --- a/here/entry.py +++ b/here/entry.py @@ -27,7 +27,7 @@ def process_coordinate(text: str) -> Position: def process_dimension(text: str) -> str: - return text.replace(re.match(r'[\w ]+: ', text).group(), '', 1) + return text.replace(re.match(r'[\w ]+: ', text).group(), '', 1).strip('"\' ') def coordinate_text(x: float, y: float, z: float, dimension: Dimension): @@ -98,7 +98,7 @@ def on_info(server: PluginServerInterface, info: Info): server.execute('data get entity ' + info.player) if not info.is_player and here_user > 0 and re.match(r'\w+ has the following entity data: ', info.content) is not None: name = info.content.split(' ')[0] - dimension = re.search(r'(?<= Dimension: )(.*?),', info.content).group().replace('"', '').replace(',', '') + dimension = re.search(r'(?<= Dimension: )(.*?),', info.content).group().replace('"', '').replace("'", '').replace(',', '') position_str = re.search(r'(?<=Pos: )\[.*?]', info.content).group() position = process_coordinate(position_str) display(server, name, position, dimension) diff --git a/mcdreforged.plugin.json b/mcdreforged.plugin.json index d72be28..1f46355 100644 --- a/mcdreforged.plugin.json +++ b/mcdreforged.plugin.json @@ -1,6 +1,6 @@ { "id": "here", - "version": "1.2.1", + "version": "1.2.2", "name": "Here", "description": { "en_us": "Broadcast your position and high light yourself",