Add missing Locale parameter to String.format calls, Fixes getArmorResource functionality on some locaales. (#8463)

This commit is contained in:
Take Weiland authored and GitHub committed 2022-02-15 09:27:10 -08:00
1 parent 21787234f4
commit c3e0b071a2
30 files changed
+107 -80

No files matched your search

@@ -245,7 +245,7 @@ public class GameData
public static <K extends IForgeRegistryEntry<K>> K register_impl(K value)
{
Validate.notNull(value, "Attempted to register a null object");
Validate.notNull(value.getRegistryName(), String.format("Attempt to register object without having set a registry name %s (type %s)", value, value.getClass().getName()));
Validate.notNull(value.getRegistryName(), String.format(Locale.ENGLISH, "Attempt to register object without having set a registry name %s (type %s)", value, value.getClass().getName()));
final IForgeRegistry<K> registry = RegistryManager.ACTIVE.getRegistry(value.getRegistryType());
Validate.notNull(registry, "Attempted to registry object without creating registry first: " + value.getRegistryType().getName());
registry.register(value);
@@ -439,11 +439,11 @@ public class GameData
if (block.getRegistryName().getNamespace().equals("minecraft") && !oldContainer.getProperties().equals(newContainer.getProperties()))
{
String oldSequence = oldContainer.getProperties().stream()
.map(s -> String.format("%s={%s}", s.getName(),
.map(s -> String.format(Locale.ENGLISH, "%s={%s}", s.getName(),
s.getPossibleValues().stream().map(Object::toString).collect(Collectors.joining( "," ))))
.collect(Collectors.joining(";"));
String newSequence = newContainer.getProperties().stream()
.map(s -> String.format("%s={%s}", s.getName(),
.map(s -> String.format(Locale.ENGLISH, "%s={%s}", s.getName(),
s.getPossibleValues().stream().map(Object::toString).collect(Collectors.joining( "," ))))
.collect(Collectors.joining(";"));
@@ -634,7 +634,7 @@ public class GameData
PoiType oldType = map.put(state, obj);
if (oldType != null)
{
throw new IllegalStateException(String.format("Point of interest types %s and %s both list %s in their blockstates, this is not allowed. Blockstates can only have one point of interest type each.", oldType, obj, state));
throw new IllegalStateException(String.format(Locale.ENGLISH, "Point of interest types %s and %s both list %s in their blockstates, this is not allowed. Blockstates can only have one point of interest type each.", oldType, obj, state));
}
});
}