From 78cecb27d78da8348d84b689f9b605cfb04955e8 Mon Sep 17 00:00:00 2001 From: Xephi Date: Sun, 21 Sep 2014 00:04:22 +0200 Subject: [PATCH] Fix Converter command --- .../fr/xephi/authme/commands/ConverterCommand.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/xephi/authme/commands/ConverterCommand.java b/src/main/java/fr/xephi/authme/commands/ConverterCommand.java index 16ddb976a..70ef8c919 100644 --- a/src/main/java/fr/xephi/authme/commands/ConverterCommand.java +++ b/src/main/java/fr/xephi/authme/commands/ConverterCommand.java @@ -47,7 +47,7 @@ public class ConverterCommand implements CommandExecutor { return true; } - ConvertType type = ConvertType.valueOf(args[0]); + ConvertType type = ConvertType.fromName(args[0]); if (type == null) { m._(sender, "error"); return true; @@ -111,8 +111,12 @@ public class ConverterCommand implements CommandExecutor { return this.name; } - ConvertType fromName(String name) { - return ConvertType.valueOf(name); + public static ConvertType fromName(String name) { + for (ConvertType type : ConvertType.values()) { + if (type.getName().equalsIgnoreCase(name)) + return type; + } + return null; } } }