From e439c778a6772880fed9a1446fefa9b365929d51 Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Sun, 1 Jan 2017 16:13:47 -0500 Subject: [PATCH] Use the correct JsonReader constructor in 1.8 Fixes aadnk#121 --- .../com/comphenix/protocol/wrappers/ComponentParser.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/API/src/main/java/com/comphenix/protocol/wrappers/ComponentParser.java b/modules/API/src/main/java/com/comphenix/protocol/wrappers/ComponentParser.java index 7f3b0573..29ef6e68 100644 --- a/modules/API/src/main/java/com/comphenix/protocol/wrappers/ComponentParser.java +++ b/modules/API/src/main/java/com/comphenix/protocol/wrappers/ComponentParser.java @@ -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); } } -} \ No newline at end of file +}