Correctly remove escape sequences from parsed names

This commit is contained in:
George Paton 2024-04-02 09:56:19 +11:00
parent a259ba716f
commit 4e416f18b6

View File

@ -56,7 +56,7 @@ public class GUIScreenWikiRender extends GuiScreen {
GL11.glEnable(GL11.GL_LIGHTING);
try {
String slotName = preview[index].getDisplayName().replaceAll("[^\\w ().-]+", "");
String slotName = preview[index].getDisplayName().replaceAll("§.", "").replaceAll("[^\\w ().-]+", "");
if(!slotName.endsWith(".name")) {
saveScreenshot(Minecraft.getMinecraft().mcDataDir, "Slot " + slotName + ".png", 2, 2, 32, 32, 0xFF8B8B8B);
}