From 16111449b42f544dadf77537a14d99d52d516bab Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Tue, 31 Mar 2015 19:31:11 -0400 Subject: [PATCH] Restore compatibility with 1.8 --- .../protocol/injector/netty/NettyProtocolRegistry.java | 4 ++-- .../comphenix/protocol/utility/MinecraftReflection.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolRegistry.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolRegistry.java index 3a70993d..044a40e4 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolRegistry.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/netty/NettyProtocolRegistry.java @@ -111,8 +111,8 @@ public class NettyProtocolRegistry { private synchronized void initialize() { Object[] protocols = enumProtocol.getEnumConstants(); - // TODO: Fins a better less than 1.7 check - if (MinecraftVersion.getCurrentVersion().compareTo(MinecraftVersion.BOUNTIFUL_UPDATE) <= 0) { + // TODO: Find a better less than 1.7 check + if (MinecraftVersion.getCurrentVersion().compareTo(MinecraftVersion.BOUNTIFUL_UPDATE) < 0) { initialize17(); return; } diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java index bf7fc643..a994fc97 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java @@ -74,7 +74,6 @@ import com.comphenix.protocol.wrappers.nbt.NbtFactory; import com.comphenix.protocol.wrappers.nbt.NbtType; import com.google.common.base.Joiner; import com.google.common.collect.Maps; -import com.google.gson.Gson; import com.mojang.authlib.GameProfile; /** @@ -1695,7 +1694,11 @@ public class MinecraftReflection { * @return The GSON class. */ public static Class getMinecraftGsonClass() { - return Gson.class; + try { + return getClass("com.google.gson.Gson"); + } catch (RuntimeException e) { + return getClass("org.bukkit.craftbukkit.libs.com.google.gson.Gson"); + } } /**