mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 17:54:50 +00:00
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
19 lines
529 B
Java
19 lines
529 B
Java
package codechicken.nei.api;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import net.minecraft.util.EnumChatFormatting;
|
|
|
|
/**
|
|
* Lets you just override those things you want to
|
|
*/
|
|
public class INEIGuiAdapter implements INEIGuiHandler {
|
|
|
|
static final Pattern SPECIAL_REGEX_CHARS = Pattern.compile("[{}()\\[\\].+*?^$\\\\|]");
|
|
|
|
protected String formattingText(String displayName) {
|
|
return SPECIAL_REGEX_CHARS.matcher(EnumChatFormatting.getTextWithoutFormattingCodes(displayName))
|
|
.replaceAll("\\\\$0");
|
|
}
|
|
}
|