Skip to content

Commit

Permalink
Remove redundant toLowerCase
Browse files Browse the repository at this point in the history
  • Loading branch information
tal5 committed Jul 10, 2024
1 parent 995d6b0 commit 1d5dbcf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
public class LegacyNamingHelper<T extends Enum<T>> {

// TODO once 1.21 is the minimum supported version, replace with direct registry-based handling
@SuppressWarnings({"unchecked", "rawtypes"})
@SuppressWarnings({"unchecked", "rawtypes", "DataFlowIssue"})
public static <T extends Keyed> T convert(Class<T> type, String string) {
if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) {
return Bukkit.getRegistry(type).get(Utilities.parseNamespacedKey(CoreUtilities.toLowerCase(string)));
return Bukkit.getRegistry(type).get(Utilities.parseNamespacedKey(string));
}
return (T) ElementTag.asEnum((Class<? extends Enum>) type, string);
}
Expand Down

0 comments on commit 1d5dbcf

Please sign in to comment.