diff --git a/src/main/java/galena/copperative/config/CommonConfig.java b/src/main/java/galena/copperative/config/CommonConfig.java index fe4d648..1e60dc5 100644 --- a/src/main/java/galena/copperative/config/CommonConfig.java +++ b/src/main/java/galena/copperative/config/CommonConfig.java @@ -17,6 +17,7 @@ import java.util.Collection; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.function.BooleanSupplier; import java.util.function.Predicate; @@ -131,7 +132,7 @@ public CommonConfig(ConfigBuilder builder) { var property = builder.define("enabled", true); var targets = ImmutableMap.builder(); for (OverrideTarget target : OverrideTarget.values()) { - var targetProperty = builder.define(target.name().toLowerCase(), true); + var targetProperty = builder.define(target.name().toLowerCase(Locale.ROOT), true); targets.put(target, targetProperty::get); } diff --git a/src/main/java/galena/copperative/config/OverwriteEnabledCondition.java b/src/main/java/galena/copperative/config/OverwriteEnabledCondition.java index 85ccc59..38869d9 100644 --- a/src/main/java/galena/copperative/config/OverwriteEnabledCondition.java +++ b/src/main/java/galena/copperative/config/OverwriteEnabledCondition.java @@ -11,6 +11,7 @@ import net.minecraftforge.registries.ForgeRegistries; import javax.annotation.Nullable; +import java.util.Locale; import java.util.Objects; public class OverwriteEnabledCondition implements ICondition { @@ -47,7 +48,7 @@ public static class Serializer implements IConditionSerializer> blocks, String base) blocks.forEach(block -> { if(block.get() instanceof WeatheringCopper copper && copper.getAge() != WeatheringCopper.WeatherState.UNAFFECTED) { var name = copper.getAge().name(); - var prefix = name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(); + var prefix = name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase(Locale.ROOT); addBlock(block, prefix + " " + base); } else { addBlock(block, base); diff --git a/src/main/java/galena/copperative/data/provider/CItemModelProvider.java b/src/main/java/galena/copperative/data/provider/CItemModelProvider.java index 279899b..dc98b09 100644 --- a/src/main/java/galena/copperative/data/provider/CItemModelProvider.java +++ b/src/main/java/galena/copperative/data/provider/CItemModelProvider.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.Locale; import java.util.function.Supplier; public abstract class CItemModelProvider extends ItemModelProvider { @@ -151,7 +152,7 @@ public ItemModelBuilder cogBlock(Block block) { public String weatherPrefix(Block block) { if (block instanceof WeatheringCopper it) { var age = it.getAge(); - if (age != WeatheringCopper.WeatherState.UNAFFECTED) return age.name().toLowerCase() + "_"; + if (age != WeatheringCopper.WeatherState.UNAFFECTED) return age.name().toLowerCase(Locale.ROOT) + "_"; } return ""; } diff --git a/src/main/java/galena/copperative/index/CBlocks.java b/src/main/java/galena/copperative/index/CBlocks.java index d146526..eae2bc7 100644 --- a/src/main/java/galena/copperative/index/CBlocks.java +++ b/src/main/java/galena/copperative/index/CBlocks.java @@ -147,7 +147,7 @@ public static RegistryObject register(String name, Supplier public static CopperSet registerConvertedSet(String name, Supplier targetSupplier, Function function, CreativeModeTab tab) { var weathered = Stream.of(WeatherState.EXPOSED, WeatherState.WEATHERED, WeatherState.OXIDIZED).>map(weatherState -> { - String prefix = weatherState.name().toLowerCase() + "_"; + String prefix = weatherState.name().toLowerCase(Locale.ROOT) + "_"; return register(prefix + name, () -> function.apply(weatherState), tab); }).toList(); return new CopperSet<>(targetSupplier, weathered); @@ -162,7 +162,7 @@ public static List> registerWeatheringSet(Un WeatherState[] wStates = WeatherState.values(); ArrayList> blocks = new ArrayList<>(4); for (final WeatherState weatherState : wStates) { - String prefix = weatherState.equals(WeatherState.UNAFFECTED) ? "" : weatherState.name().toLowerCase() + "_"; + String prefix = weatherState.equals(WeatherState.UNAFFECTED) ? "" : weatherState.name().toLowerCase(Locale.ROOT) + "_"; Supplier supplier = () -> function.apply(weatherState); blocks.add(register(name.apply(prefix), supplier, tab)); }