From 6ede5868663560702bc23ff43ae2841c28165f8d Mon Sep 17 00:00:00 2001 From: JFronny Date: Fri, 10 May 2024 14:28:10 +0200 Subject: [PATCH] chore: clean up a bit --- .../java/io/gitlab/jfronny/translater/Translater.java | 7 ------- .../jfronny/translater/transformer/TransformingMap.java | 3 +-- .../translater/transformer/TranslatingTransformer.java | 9 ++++----- 3 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/client/java/io/gitlab/jfronny/translater/Translater.java b/src/client/java/io/gitlab/jfronny/translater/Translater.java index 48bde5a..ee23437 100644 --- a/src/client/java/io/gitlab/jfronny/translater/Translater.java +++ b/src/client/java/io/gitlab/jfronny/translater/Translater.java @@ -19,13 +19,6 @@ public class Translater { public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); private static final TransformingMap map = new TransformingMap(new CachingTransformer(new TranslatingTransformer<>(TranslateService.getConfigured()))); - public static boolean progressUIEnabled() { - return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Gui; - } - public static boolean progressLogsEnabled() { - return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Console; - } - public static @NotNull TransformingMap getMap(@Nullable Map base) { if (base != null) map.updateBacker(base); return map; diff --git a/src/client/java/io/gitlab/jfronny/translater/transformer/TransformingMap.java b/src/client/java/io/gitlab/jfronny/translater/transformer/TransformingMap.java index c6de36d..efe1e7a 100644 --- a/src/client/java/io/gitlab/jfronny/translater/transformer/TransformingMap.java +++ b/src/client/java/io/gitlab/jfronny/translater/transformer/TransformingMap.java @@ -1,9 +1,8 @@ package io.gitlab.jfronny.translater.transformer; +import io.gitlab.jfronny.translater.Cfg; import io.gitlab.jfronny.translater.RenderScheduler; import io.gitlab.jfronny.translater.Translater; -import io.gitlab.jfronny.translater.mixin.MinecraftClientAccessor; -import net.minecraft.client.MinecraftClient; import java.util.Collection; import java.util.Map; diff --git a/src/client/java/io/gitlab/jfronny/translater/transformer/TranslatingTransformer.java b/src/client/java/io/gitlab/jfronny/translater/transformer/TranslatingTransformer.java index b935373..310f2cd 100644 --- a/src/client/java/io/gitlab/jfronny/translater/transformer/TranslatingTransformer.java +++ b/src/client/java/io/gitlab/jfronny/translater/transformer/TranslatingTransformer.java @@ -69,10 +69,8 @@ public class TranslatingTransformer implements Transformer { } else { return translateMultiple(str); } - } - catch (Exception e) { - Translater.LOGGER.warn("Failed to transform: \"{}\" ({} characters)", str, str.length()); - Translater.LOGGER.warn("Please report this bug with the mod containing the lang file"); + } catch (Exception e) { + Translater.LOGGER.warn("Failed to transform: \"{}\" ({} characters)! Please report this bug with the mod containing the lang file! ({})", str, str.length(), e.getLocalizedMessage()); return null; } } @@ -109,7 +107,8 @@ public class TranslatingTransformer implements Transformer { if (Cfg.detailedProgress) Translater.LOGGER.info("Transformed: \"{}\" to: \"{}\"", str, currentState); return currentState; } catch (Exception e) { - Translater.LOGGER.warn("Failed to break: \"{}\" ({} characters). Is your API key valid?", m.group(2), m.group(2).length()); + String s = m.group(2); + Translater.LOGGER.warn("Failed to break: \"{}\" ({} characters). Is your API key valid? ({})", s, s.length(), e.getLocalizedMessage()); throw e; } }