/** * Returns a representation that accepts and outputs formatting codes, using * the provided formatting character. * * @param formattingChar The formatting character to parse and serialize * with * @return The appropriate legacy representation handler */ @SuppressWarnings("deprecation") public static FormattingCodeTextSerializer formattingCode(char formattingChar) { if (formattingChar == LEGACY_FORMATTING_CODE.getCharacter()) { return LEGACY_FORMATTING_CODE; } else if (formattingChar == FORMATTING_CODE.getCharacter()) { return FORMATTING_CODE; } else { return Sponge.getRegistry().getTextSerializerFactory().getFormattingCodeTextSerializer(formattingChar); } }
/** * Returns a representation that accepts and outputs formatting codes, using * the provided formatting character. * * @param formattingChar The formatting character to parse and serialize * with * @return The appropriate legacy representation handler */ @SuppressWarnings("deprecation") public static FormattingCodeTextSerializer formattingCode(char formattingChar) { if (formattingChar == LEGACY_FORMATTING_CODE.getCharacter()) { return LEGACY_FORMATTING_CODE; } else if (formattingChar == FORMATTING_CODE.getCharacter()) { return FORMATTING_CODE; } else { return Sponge.getRegistry().getTextSerializerFactory().getFormattingCodeTextSerializer(formattingChar); } }