Set default locale to English because of dumb bugs

This commit is contained in:
libraryaddict 2020-08-06 00:43:21 +12:00
parent 4b49b147e3
commit 788bc7bc3b

View File

@ -36,10 +36,7 @@ import java.io.InputStreamReader;
import java.lang.reflect.*; import java.lang.reflect.*;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.ArrayList; import java.util.*;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.jar.JarFile; import java.util.jar.JarFile;
@ -66,6 +63,10 @@ public class ReflectionManager {
private static NmsVersion version; private static NmsVersion version;
public static void init() { public static void init() {
// Sometimes it doesn't like me if I don't set this :\
// Weird characters in toLowerCase() for example
Locale.setDefault(Locale.ENGLISH);
try { try {
Object entity = createEntityInstance(DisguiseType.COW, "Cow"); Object entity = createEntityInstance(DisguiseType.COW, "Cow");
@ -1678,6 +1679,7 @@ public class ReflectionManager {
private static void createNMSValues(DisguiseType disguiseType) { private static void createNMSValues(DisguiseType disguiseType) {
String nmsEntityName = toReadable(disguiseType.name()); String nmsEntityName = toReadable(disguiseType.name());
Class nmsClass = ReflectionManager.getNmsClassIgnoreErrors("Entity" + nmsEntityName); Class nmsClass = ReflectionManager.getNmsClassIgnoreErrors("Entity" + nmsEntityName);
if (nmsClass == null || Modifier.isAbstract(nmsClass.getModifiers())) { if (nmsClass == null || Modifier.isAbstract(nmsClass.getModifiers())) {
@ -1934,7 +1936,7 @@ public class ReflectionManager {
String[] split = string.split("_"); String[] split = string.split("_");
for (int i = 0; i < split.length; i++) { for (int i = 0; i < split.length; i++) {
split[i] = split[i].substring(0, 1) + split[i].substring(1).toLowerCase(); split[i] = split[i].charAt(0) + split[i].substring(1).toLowerCase();
} }
return split; return split;