Archiviert
13
0

Merge branch 'master' of git+ssh://git@github.com/dmulloy2/ProtocolLib

Dieser Commit ist enthalten in:
Dan Mulloy 2017-02-04 12:12:54 -05:00
Commit 57cfbc4f81

Datei anzeigen

@ -17,6 +17,7 @@
package com.comphenix.protocol.wrappers;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
import java.lang.reflect.Method;
@ -45,7 +46,7 @@ public class ComponentParser {
private static Object deserializeLegacy(Object gson, Class<?> component, StringReader str) {
try {
Class<?> readerClass = Class.forName("org.bukkit.craftbukkit.libs.com.google.gson.stream.JsonReader");
Object reader = readerClass.getConstructor(StringReader.class).newInstance(str);
Object reader = readerClass.getConstructor(Reader.class).newInstance(str);
Method setLenient = readerClass.getMethod("setLenienent", boolean.class);
setLenient.invoke(reader, true);
Method getAdapter = gson.getClass().getMethod("getAdapter", Class.class);
@ -56,4 +57,4 @@ public class ComponentParser {
throw new RuntimeException("Failed to read JSON", ex);
}
}
}
}