mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-27 21:26:17 +01:00
Restore backwards compatibility with server pings
I don't know why people are using 1.8.1, but whatever
This commit is contained in:
parent
b17af68716
commit
0c705ef59d
@ -1652,16 +1652,22 @@ public class MinecraftReflection {
|
||||
return getMinecraftClass("TileEntity");
|
||||
}
|
||||
|
||||
private static Class<?> gsonClass = null;
|
||||
|
||||
/**
|
||||
* Retrieve the Gson class used by Minecraft.
|
||||
* @return The GSON class.
|
||||
* @return The Gson class.
|
||||
*/
|
||||
public static Class<?> getMinecraftGsonClass() {
|
||||
try {
|
||||
return getClass("com.google.gson.Gson");
|
||||
} catch (RuntimeException e) {
|
||||
return getClass("org.bukkit.craftbukkit.libs.com.google.gson.Gson");
|
||||
if (gsonClass == null) {
|
||||
try {
|
||||
return gsonClass = getClass("org.bukkit.craftbukkit.libs.com.google.gson.Gson");
|
||||
} catch (RuntimeException e) {
|
||||
return gsonClass = getClass("com.google.gson.Gson");
|
||||
}
|
||||
}
|
||||
|
||||
return gsonClass;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user