Fix Converter command

This commit is contained in:
Xephi 2014-09-21 00:04:22 +02:00
parent 312410c9de
commit 78cecb27d7

View File

@ -47,7 +47,7 @@ public class ConverterCommand implements CommandExecutor {
return true; return true;
} }
ConvertType type = ConvertType.valueOf(args[0]); ConvertType type = ConvertType.fromName(args[0]);
if (type == null) { if (type == null) {
m._(sender, "error"); m._(sender, "error");
return true; return true;
@ -111,8 +111,12 @@ public class ConverterCommand implements CommandExecutor {
return this.name; return this.name;
} }
ConvertType fromName(String name) { public static ConvertType fromName(String name) {
return ConvertType.valueOf(name); for (ConvertType type : ConvertType.values()) {
if (type.getName().equalsIgnoreCase(name))
return type;
}
return null;
} }
} }
} }