From 2f8e1d453cf9e90a6bf5e50622490c768de7214f Mon Sep 17 00:00:00 2001 From: symt <28537235+symt@users.noreply.github.com> Date: Mon, 7 Oct 2024 15:25:26 -0500 Subject: [PATCH] minor refactoring --- src/main/java/dev/meyi/bn/json/Order.java | 3 +-- src/main/java/dev/meyi/bn/utilities/RenderUtils.java | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/dev/meyi/bn/json/Order.java b/src/main/java/dev/meyi/bn/json/Order.java index 5fd56f8..b48250f 100644 --- a/src/main/java/dev/meyi/bn/json/Order.java +++ b/src/main/java/dev/meyi/bn/json/Order.java @@ -111,8 +111,7 @@ public void updateStatus() { RenderUtils.chatNotification(this, "MATCHED"); } else if (OrderStatus.OUTDATED.equals(newOrderStatus)) { RenderUtils.chatNotification(this, "OUTDATED"); - RenderUtils.sendSound(); - + RenderUtils.sendSound(); // might be loud if multiple become oudated at the same time } this.orderStatus = newOrderStatus; } diff --git a/src/main/java/dev/meyi/bn/utilities/RenderUtils.java b/src/main/java/dev/meyi/bn/utilities/RenderUtils.java index 756145a..ad7989d 100644 --- a/src/main/java/dev/meyi/bn/utilities/RenderUtils.java +++ b/src/main/java/dev/meyi/bn/utilities/RenderUtils.java @@ -81,8 +81,10 @@ public static int getStringWidth(String string) { } public static void sendSound() { - if (!BazaarNotifier.config.sendSound) return; - Minecraft.getMinecraft().thePlayer.playSound("mob.horse.donkey.death", 2.0F, 1.0F); // Todo: add option for which sound to play (possibly) + if (BazaarNotifier.config.sendSound) { + Minecraft.getMinecraft().thePlayer.playSound("mob.horse.donkey.death", 2.0F, 1.0F); + // TODO: add option for which sound to play (possibly) + } } public static void chatNotification(Order order, String notification) { if (!BazaarNotifier.config.showChatMessages) {