mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Add missing Locale parameter to String.format calls, Fixes getArmorResource functionality on some locaales. (#8463)
This commit is contained in:
1 parent
21787234f4
commit
c3e0b071a2
30 files changed
+107
-80
No files matched your search
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
* Copyright (c) 2016-2022.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -34,6 +34,7 @@ import org.lwjgl.system.MemoryUtil;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryUsage;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Locale;
|
||||
|
||||
public class EarlyLoaderGUI {
|
||||
private final Minecraft minecraft;
|
||||
@@ -119,7 +120,7 @@ public class EarlyLoaderGUI {
|
||||
final MemoryUsage heapusage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
|
||||
final MemoryUsage offheapusage = ManagementFactory.getMemoryMXBean().getNonHeapMemoryUsage();
|
||||
final float pctmemory = (float) heapusage.getUsed() / heapusage.getMax();
|
||||
String memory = String.format("Memory Heap: %d / %d MB (%.1f%%) OffHeap: %d MB", heapusage.getUsed() >> 20, heapusage.getMax() >> 20, pctmemory * 100.0, offheapusage.getUsed() >> 20);
|
||||
String memory = String.format(Locale.ENGLISH, "Memory Heap: %d / %d MB (%.1f%%) OffHeap: %d MB", heapusage.getUsed() >> 20, heapusage.getMax() >> 20, pctmemory * 100.0, offheapusage.getUsed() >> 20);
|
||||
|
||||
final int i = Mth.hsvToRgb((1.0f - (float)Math.pow(pctmemory, 1.5f)) / 3f, 1.0f, 0.5f);
|
||||
memorycolour[2] = ((i) & 0xFF) / 255.0f;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
* Copyright (c) 2016-2022.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -125,7 +125,7 @@ public class ModelLoaderRegistry
|
||||
{
|
||||
if (!loaders.containsKey(loaderId))
|
||||
{
|
||||
throw new IllegalStateException(String.format("Model loader '%s' not found. Registered loaders: %s", loaderId,
|
||||
throw new IllegalStateException(String.format(Locale.ENGLISH, "Model loader '%s' not found. Registered loaders: %s", loaderId,
|
||||
loaders.keySet().stream().map(ResourceLocation::toString).collect(Collectors.joining(", "))));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2021.
|
||||
* Copyright (c) 2016-2022.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
@@ -34,6 +34,7 @@ import java.util.Deque;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -157,7 +158,7 @@ public class B3DModel
|
||||
{
|
||||
if(brush > brushes.size())
|
||||
{
|
||||
throw new IOException(String.format("brush %s is out of range", brush));
|
||||
throw new IOException(String.format(Locale.ENGLISH, "brush %s is out of range", brush));
|
||||
}
|
||||
else if(brush == -1) return null;
|
||||
return brushes.get(brush);
|
||||
@@ -169,7 +170,7 @@ public class B3DModel
|
||||
{
|
||||
if(vertex > vertices.size())
|
||||
{
|
||||
throw new IOException(String.format("vertex %s is out of range", vertex));
|
||||
throw new IOException(String.format(Locale.ENGLISH, "vertex %s is out of range", vertex));
|
||||
}
|
||||
return vertices.get(vertex);
|
||||
}
|
||||
@@ -225,7 +226,7 @@ public class B3DModel
|
||||
if(version / 100 > Parser.version / 100)
|
||||
throw new IOException("Unsupported major model version: " + ((float)version / 100));
|
||||
if(version % 100 > Parser.version % 100)
|
||||
logger.warn(String.format("Minor version difference in model: %s", ((float)version / 100)));
|
||||
logger.warn(String.format(Locale.ENGLISH, "Minor version difference in model: %s", ((float)version / 100)));
|
||||
List<Texture> textures = Collections.emptyList();
|
||||
List<Brush> brushes = Collections.emptyList();
|
||||
Node<?> root = null;
|
||||
@@ -325,7 +326,7 @@ public class B3DModel
|
||||
tex_coords[i] = new Vector4f(buf.getFloat(), buf.getFloat(), buf.getFloat(), buf.getFloat());
|
||||
break;
|
||||
default:
|
||||
logger.error(String.format("Unsupported number of texture coords: %s", tex_coord_set_size));
|
||||
logger.error(String.format(Locale.ENGLISH, "Unsupported number of texture coords: %s", tex_coord_set_size));
|
||||
tex_coords[i] = new Vector4f(0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
@@ -586,7 +587,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Texture [path=%s, flags=%s, blend=%s, pos=%s, scale=%s, rot=%s]", path, flags, blend, pos, scale, rot);
|
||||
return String.format(Locale.ENGLISH, "Texture [path=%s, flags=%s, blend=%s, pos=%s, scale=%s, rot=%s]", path, flags, blend, pos, scale, rot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -642,7 +643,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Brush [name=%s, color=%s, shininess=%s, blend=%s, fx=%s, textures=%s]", name, color, shininess, blend, fx, textures);
|
||||
return String.format(Locale.ENGLISH, "Brush [name=%s, color=%s, shininess=%s, blend=%s, fx=%s, textures=%s]", name, color, shininess, blend, fx, textures);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -731,7 +732,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Vertex [pos=%s, normal=%s, color=%s, texCoords=%s]", pos, normal, color, java.util.Arrays.toString(texCoords));
|
||||
return String.format(Locale.ENGLISH, "Vertex [pos=%s, normal=%s, color=%s, texCoords=%s]", pos, normal, color, java.util.Arrays.toString(texCoords));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -780,7 +781,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Face [v1=%s, v2=%s, v3=%s]", v1, v2, v3);
|
||||
return String.format(Locale.ENGLISH, "Face [v1=%s, v2=%s, v3=%s]", v1, v2, v3);
|
||||
}
|
||||
|
||||
public Vector3f getNormal()
|
||||
@@ -838,7 +839,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Key [pos=%s, scale=%s, rot=%s]", pos, scale, rot);
|
||||
return String.format(Locale.ENGLISH, "Key [pos=%s, scale=%s, rot=%s]", pos, scale, rot);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -880,7 +881,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Animation [flags=%s, frames=%s, fps=%s, keys=...]", flags, frames, fps);
|
||||
return String.format(Locale.ENGLISH, "Animation [flags=%s, frames=%s, fps=%s, keys=...]", flags, frames, fps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,7 +1008,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Node [name=%s, kind=%s, pos=%s, scale=%s, rot=%s, keys=..., nodes=..., animation=%s]", name, kind, pos, scale, rot, animation);
|
||||
return String.format(Locale.ENGLISH, "Node [name=%s, kind=%s, pos=%s, scale=%s, rot=%s, keys=..., nodes=..., animation=%s]", name, kind, pos, scale, rot, animation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1081,7 +1082,7 @@ public class B3DModel
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("Mesh [pivot=%s, brush=%s, data=...]", super.toString(), brush);
|
||||
return String.format(Locale.ENGLISH, "Mesh [pivot=%s, brush=%s, data=...]", super.toString(), brush);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user