public static void clear(final Player p) { if (((CraftPlayer) p).getHandle().playerConnection.networkManager.getVersion() < Title.VERSION) { return; } ((CraftPlayer) p) .getHandle() .playerConnection .sendPacket( (Packet) new ProtocolInjector.PacketTitle(ProtocolInjector.PacketTitle.Action.CLEAR)); }
public static void sendSubTitle(final Player p, final String subtitle) { if (((CraftPlayer) p).getHandle().playerConnection.networkManager.getVersion() < Title.VERSION) { return; } ((CraftPlayer) p) .getHandle() .playerConnection .sendPacket( (Packet) new ProtocolInjector.PacketTitle( ProtocolInjector.PacketTitle.Action.SUBTITLE, ChatSerializer.a("{\"text\": \"\"}").a(subtitle))); }