From da4bd4975afdb2c132ea26f83284fa351a2e4ed1 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Sat, 9 Jul 2022 10:50:47 +0200 Subject: [PATCH] 2.8.6 Bugfix: If in a function the CustomSound was deactivated, the message came that the CustomSound does not exist, if none was specified and if one was specified, the CustomSound was played additionally. This has been fixed. --- CommandGUI V2/pom.xml | 2 +- .../java/de/jatitv/commandguiv2/Spigot/sound/Sound.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CommandGUI V2/pom.xml b/CommandGUI V2/pom.xml index 3b9e802..782ab67 100644 --- a/CommandGUI V2/pom.xml +++ b/CommandGUI V2/pom.xml @@ -6,7 +6,7 @@ net.t2code CommandGUI_V2 - 2.8.5 + 2.8.6 jar CommandGUI diff --git a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/sound/Sound.java b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/sound/Sound.java index d325428..995d11f 100644 --- a/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/sound/Sound.java +++ b/CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/sound/Sound.java @@ -28,14 +28,17 @@ public class Sound { break; case Click: if (!SelectConfig.getSound_Click_Enable()) return; - if (!function.customSound_Enable) player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1); + if (!function.customSound_Enable) { + player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1); + return; + } if (function.customSound_NoSound) return; try { player.playSound(player.getLocation(), org.bukkit.Sound.valueOf(function.customSound_Sound.toUpperCase().replace(".", "_")), 3, 1); } catch (Exception e1) { send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix) - .replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.guiName) + "§r §6Slot: §e" + slot.slot + " §6CustomSound: §9" + function.customSound_Sound)); + .replace("[sound]", "§6GUI: §e" + gui.key + " §6Function: §e" + function.key + "§r §6Slot: §e" + (slot.slot + 1) + " §6CustomSound: §9" + function.customSound_Sound)); player.playSound(player.getLocation(), SelectConfig.getSound_Click(), 3, 1); } break;