From 18a45aace0b35bd989ec506134d690c982c1af4c Mon Sep 17 00:00:00 2001 From: Dan Mulloy Date: Mon, 1 Dec 2014 16:11:27 -0500 Subject: [PATCH] Fix an issue getting chat component arrays --- .../java/com/comphenix/protocol/events/PacketContainer.java | 2 +- .../com/comphenix/protocol/utility/MinecraftReflection.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java index fbb60e23..94af96b3 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java @@ -614,7 +614,7 @@ public class PacketContainer implements Serializable { public StructureModifier getChatComponentArrays() { // Convert to and from the Bukkit wrapper return structureModifier.withType( - MinecraftReflection.getIChatBaseComponentClass(), + MinecraftReflection.getIChatBaseComponentArrayClass(), BukkitConverters.getIgnoreNull(new WrappedChatComponentArrayConverter())); } 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 416d9fd7..49d6f516 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/utility/MinecraftReflection.java @@ -742,6 +742,10 @@ public class MinecraftReflection { } } + public static Class getIChatBaseComponentArrayClass() { + return getArrayClass(getIChatBaseComponentClass()); + } + /** * Retrieve the NMS chat component text class. * @return The chat component class.