Ejemplo n.º 1
0
 @Override
 public void setTabHeader(BaseComponent[] header, BaseComponent[] footer) {
   if (pendingConnection.getVersion() >= ProtocolConstants.MINECRAFT_1_8) {
     unsafe()
         .sendPacket(
             new PlayerListHeaderFooter(
                 (header != null) ? ComponentSerializer.toString(header) : EMPTY_TEXT,
                 (footer != null) ? ComponentSerializer.toString(footer) : EMPTY_TEXT));
   }
 }
Ejemplo n.º 2
0
 @Override
 public void sendMessage(ChatMessageType position, BaseComponent message) {
   // Action bar doesn't display the new JSON formattings, legacy works - send it using this for
   // now
   if (position == ChatMessageType.ACTION_BAR
       && pendingConnection.getVersion() >= ProtocolConstants.MINECRAFT_1_8) {
     sendMessage(
         position,
         ComponentSerializer.toString(new TextComponent(TextComponent.toLegacyText(message))));
   } else {
     sendMessage(position, ComponentSerializer.toString(message));
   }
 }