def _get_server_stdout_raw_result(cls, text: str) -> Info: raw_result = super()._get_server_stdout_raw_result(text) # Minecraft <= 1.12.x might output minecraft color codes to the console # Just remove that raw_result.content = string_util.clean_minecraft_color_code( raw_result.content) return raw_result
def formatMessage(self, record): text = super().formatMessage(record) text = RColorConvertor.convert_minecraft_color_code(text) # minecraft code -> console code text = string_util.clean_minecraft_color_code(text) # clean the rest of minecraft codes if console_color_disabled: text = string_util.clean_console_color_code(text) return text
def formatMessage(self, record): text = super().formatMessage(record) # minecraft code -> console code for item in self.MC_CODE_ITEMS: if item.mc_code in text: text = text.replace(item.mc_code, item.console_code) # clean the rest of minecraft codes text = string_util.clean_minecraft_color_code(text) if console_color_disabled: text = string_util.clean_console_color_code(text) return text
def format_message(cls, message: Any) -> str: if isinstance(message, RTextBase): content = message.to_plain_text() else: content = str(message) return string_util.clean_minecraft_color_code(content)
def __cleaned_info(info): info.content = string_util.clean_minecraft_color_code(info.content) return info