diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/vanilla/MinecraftMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/vanilla/MinecraftMixin.java index eb4eb2bd..da27d4cd 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/vanilla/MinecraftMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/vanilla/MinecraftMixin.java @@ -24,10 +24,9 @@ import com.nomiceu.nomilabs.NomiLabs; import com.nomiceu.nomilabs.config.LabsConfig; -import com.nomiceu.nomilabs.config.LabsVersionConfig; import com.nomiceu.nomilabs.event.LabsResourcesRefreshedEvent; import com.nomiceu.nomilabs.mixinhelper.ResourcesObserver; -import com.nomiceu.nomilabs.util.LabsModeHelper; +import com.nomiceu.nomilabs.util.LabsDisplayHelper; /** * Allows Setting of Window Title and Icon. Also calls an event on Resources Reload. @@ -48,9 +47,7 @@ private void callResourcesRefreshedEvent(CallbackInfo ci) { require = 1) private void setCustomTitle(String title) { if (LabsConfig.advanced.windowOverrides.windowTitleOverride.isEmpty()) Display.setTitle(title); - else Display.setTitle(LabsConfig.advanced.windowOverrides.windowTitleOverride - .replace("{version}", LabsVersionConfig.formattedVersion) - .replace("{mode}", LabsModeHelper.getFormattedMode())); + else Display.setTitle(LabsDisplayHelper.getWindowTitle()); } @Inject(method = "setWindowIcon", at = @At("HEAD"), cancellable = true) diff --git a/src/main/java/com/nomiceu/nomilabs/util/LabsDisplayHelper.java b/src/main/java/com/nomiceu/nomilabs/util/LabsDisplayHelper.java new file mode 100644 index 00000000..b39d65f9 --- /dev/null +++ b/src/main/java/com/nomiceu/nomilabs/util/LabsDisplayHelper.java @@ -0,0 +1,13 @@ +package com.nomiceu.nomilabs.util; + +import com.nomiceu.nomilabs.config.LabsConfig; +import com.nomiceu.nomilabs.config.LabsVersionConfig; + +public class LabsDisplayHelper { + + public static String getWindowTitle() { + return LabsConfig.advanced.windowOverrides.windowTitleOverride + .replace("{version}", LabsVersionConfig.formattedVersion) + .replace("{mode}", LabsModeHelper.getFormattedMode()); + } +}