From 6ecdc8d7fc073d35486e24d01236f2f6cf00b51c Mon Sep 17 00:00:00 2001 From: md678685 Date: Thu, 6 Dec 2018 17:44:22 +0000 Subject: [PATCH] Enu-moo-til --- .../essentials/commands/Commandessentials.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java index 8ffac3d58..c62975bbd 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java @@ -5,10 +5,7 @@ import com.earth2me.essentials.EssentialsUpgrade; import com.earth2me.essentials.User; import com.earth2me.essentials.UserMap; import com.earth2me.essentials.metrics.Metrics; -import com.earth2me.essentials.utils.DateUtil; -import com.earth2me.essentials.utils.FloatUtil; -import com.earth2me.essentials.utils.NumberUtil; -import com.earth2me.essentials.utils.VersionUtil; +import com.earth2me.essentials.utils.*; import com.google.common.base.Charsets; import com.google.common.collect.Lists; import org.bukkit.Material; @@ -187,12 +184,8 @@ public class Commandessentials extends EssentialsCommand { private final String[] playerMoo = new String[]{" (__)", " (oo)", " /------\\/", " / | | |", " * /\\---/\\", " ~~ ~~", "....\"Have you mooed today?\"..."}; private void run_moo(final Server server, final CommandSource sender, final String command, final String args[]) { - Sound moo; - try { - moo = Sound.valueOf("COW_IDLE"); // pre-1.9 - } catch (IllegalArgumentException e) { - moo = Sound.valueOf("ENTITY_COW_MILK"); // 1.9 - } + Sound moo = EnumUtil.valueOf(Sound.class, "COW_IDLE", "ENTITY_COW_MILK"); + if (args.length == 2 && args[1].equals("moo")) { for (String s : consoleMoo) { logger.info(s);