diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index ae8cb07fd..2b7ebc288 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -17,6 +17,7 @@ package baritone.api; +import baritone.api.utils.Helper; import baritone.api.utils.NotificationHelper; import baritone.api.utils.SettingsUtil; import baritone.api.utils.TypeUtils; @@ -1147,7 +1148,10 @@ public final class Settings { * via {@link Consumer#andThen(Consumer)} or it can completely be overriden via setting * {@link Setting#value}; */ - public final Setting> logger = new Setting<>((msg, tag) -> Minecraft.getInstance().gui.getChat().addMessage(msg, null, tag)); + public final Setting> logger = new Setting<>((msg) -> { + final GuiMessageTag tag = useMessageTag.value ? Helper.MESSAGE_TAG : null; + Minecraft.getInstance().gui.getChat().addMessage(msg, null, tag); + }); /** * The function that is called when Baritone will send a desktop notification. This function can be added to diff --git a/src/api/java/baritone/api/utils/Helper.java b/src/api/java/baritone/api/utils/Helper.java index f0709c1cc..63ced2496 100755 --- a/src/api/java/baritone/api/utils/Helper.java +++ b/src/api/java/baritone/api/utils/Helper.java @@ -163,12 +163,11 @@ public interface Helper { * Send components to chat with the [Baritone] prefix * * @param logAsToast Whether to log as a toast notification - * @param useMessageTag Whether to use a message tag instead of a prefix * @param components The components to send */ - default void logDirect(boolean logAsToast, boolean useMessageTag, Component... components) { + default void logDirect(boolean logAsToast, Component... components) { MutableComponent component = Component.literal(""); - if (!logAsToast && !useMessageTag) { + if (!logAsToast && !BaritoneAPI.getSettings().useMessageTag.value) { component.append(getPrefix()); component.append(Component.literal(" ")); } @@ -176,20 +175,10 @@ public interface Helper { if (logAsToast) { logToast(getPrefix(), component); } else { - mc.execute(() -> BaritoneAPI.getSettings().logger.value.accept(component, useMessageTag ? MESSAGE_TAG : null)); + mc.execute(() -> BaritoneAPI.getSettings().logger.value.accept(component)); } } - /** - * Send components to chat with the [Baritone] prefix - * - * @param logAsToast Whether to log as a toast notification - * @param components The components to send - */ - default void logDirect(boolean logAsToast, Component... components) { - logDirect(logAsToast, BaritoneAPI.getSettings().useMessageTag.value, components); - } - /** * Send components to chat with the [Baritone] prefix *