From f55ee05b748e8ca13c27f42705ead21bbe3df707 Mon Sep 17 00:00:00 2001 From: DoKM Date: Thu, 29 Jul 2021 19:44:40 +0200 Subject: Add a open in Skycrypt (sky.shiiyu.moe) button also added a generic playSound util --- .../java/io/github/moulberry/notenoughupdates/util/Utils.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index 37e9c600..c40101ca 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -492,9 +492,12 @@ public class Utils { } public static void playPressSound() { - if(NotEnoughUpdates.INSTANCE.config.misc.guiButtonClicks) { - Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create( - new ResourceLocation("gui.button.press"), 1.0F)); + playSound(new ResourceLocation("gui.button.press"), true); + } + + public static void playSound(ResourceLocation sound, boolean gui) { + if(NotEnoughUpdates.INSTANCE.config.misc.guiButtonClicks || !gui) { + Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.create(sound, 1.0F)); } } -- cgit