Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 81df9fb

Browse files
authored
Merge pull request #15 from StrangeOne101/master
Fixed VocalMimicry issue
2 parents 353be05 + c52e464 commit 81df9fb

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@
2323
hs_err_pid*
2424
/bin/
2525
/target/
26+
.idea/*
27+
*.iml

src/me/simplicitee/project/addons/MainListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,16 @@ public void onChat(AsyncPlayerChatEvent event) {
486486
} else if (args.length != 2) {
487487
player.sendMessage(ProjectAddons.instance.prefix() + ChatColor.RED + " Invalid format, try `@vocalsound <sound>`");
488488
} else {
489-
Sound sound = Sound.valueOf(args[1].toUpperCase());
490-
491-
if (sound != null) {
489+
try {
490+
Sound sound = Sound.valueOf(args[1].toUpperCase());
491+
492492
if (plugin.getConfig().getStringList("Abilities.Air.VocalMimicry.SoundBlacklist").contains(sound.toString())) {
493493
player.sendMessage(ProjectAddons.instance.prefix() + ChatColor.RED + " Cannot use that sound!");
494494
} else {
495495
VocalMimicry.selectSound(player, sound);
496496
player.sendMessage(ProjectAddons.instance.prefix() + ChatColor.GREEN + " Successfully set vocal sound to " + args[1].toLowerCase());
497497
}
498-
} else {
498+
} catch (IllegalArgumentException e) {
499499
player.sendMessage(ProjectAddons.instance.prefix() + ChatColor.RED + " Unknown sound!");
500500
}
501501
}

src/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: ProjectAddons
22
author: Simplicitee
33
api-version: 1.16
4-
version: 1.2.2
4+
version: 1.2.3
55
main: me.simplicitee.project.addons.ProjectAddons
66
depend: [ProjectKorra]
77
commands:

0 commit comments

Comments
 (0)