1
0
mirror of https://e.coding.net/circlecloud/YumCore.git synced 2024-11-25 02:18:50 +00:00

fix: 修复Title兼容工具发包字串错误

Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
502647092 2016-08-10 10:39:37 +08:00
parent fc940c7b5a
commit 35b2d28c91

View File

@ -341,12 +341,12 @@ public class C {
sendPacket.invoke(connection, packet);
}
// Send title
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, "{text:\"" + ChatColor.translateAlternateColorCodes('&', title) + "\"}");
Object serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, "{\"text\":\"" + ChatColor.translateAlternateColorCodes('&', title) + "\"}");
packet = packetTitle.getConstructor(packetActions, nmsIChatBaseComponent).newInstance(actions[0], serialized);
sendPacket.invoke(connection, packet);
if (subtitle != "") {
// Send subtitle if present
serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, "{text:\"" + ChatColor.translateAlternateColorCodes('&', subtitle) + "\"}");
serialized = nmsChatSerializer.getMethod("a", String.class).invoke(null, "{\"text\":\"" + ChatColor.translateAlternateColorCodes('&', subtitle) + "\"}");
packet = packetTitle.getConstructor(packetActions, nmsIChatBaseComponent).newInstance(actions[1], serialized);
sendPacket.invoke(connection, packet);
}