@SuppressWarnings("null")
@Nullable
public static EnchantmentType parse(final String s) {
if (pattern.matcher(s).matches()) {
final Enchantment ench = parseEnchantment(s.substring(0, s.lastIndexOf(' ')));
if (ench == null)
return null;
return new EnchantmentType(ench, Utils.parseInt(s.substring(s.lastIndexOf(' ') + 1)));
}
final Enchantment ench = parseEnchantment(s);
if (ench == null)
return null;
return new EnchantmentType(ench, -1);
}