diff --git a/src/main/java/org/spongepowered/common/registry/VanillaRegistryLoader.java b/src/main/java/org/spongepowered/common/registry/VanillaRegistryLoader.java index fc3abb1c7e5..56afa69c2ac 100644 --- a/src/main/java/org/spongepowered/common/registry/VanillaRegistryLoader.java +++ b/src/main/java/org/spongepowered/common/registry/VanillaRegistryLoader.java @@ -207,7 +207,7 @@ private void loadEnumRegistries() { this.knownName(RegistryTypes.BANNER_PATTERN_SHAPE, BannerPattern.values(), b -> ((BannerPatternAccessor) (Object) b).accessor$filename()); this.automaticName(RegistryTypes.TROPICAL_FISH_SHAPE, TropicalFish.Pattern.values()); this.automaticName(RegistryTypes.HEIGHT_TYPE, Heightmap.Types.values()); - this.knownName(RegistryTypes.ENTITY_CATEGORY, MobCategory.values(), MobCategory::getName); + this.knownName(RegistryTypes.ENTITY_CATEGORY, MobCategory.values(), VanillaRegistryLoader.sanitizedName(MobCategory::getName)); } private static RegistryLoader criterion() { @@ -293,7 +293,7 @@ private static RegistryLoader> trigger() { @SuppressWarnings("UnusedReturnValue") private > Registry automaticName(final RegistryType type, final I[] values) { - return this.naming(type, values, value -> value.name().toLowerCase(Locale.ROOT)); + return this.naming(type, values, VanillaRegistryLoader.sanitizedName(Enum::name)); } @SuppressWarnings("UnusedReturnValue") @@ -363,4 +363,8 @@ private Registry naming(final RegistryType type, final int values, private interface Manual { void put(final I value, final String key); } + + private static Function sanitizedName(final Function original) { + return original.andThen(s -> s.toLowerCase(Locale.ROOT)); + } }