Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4146

Inventory title not being parsed for colours

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • 1.13-pre6

      Someone had started a thread about coloured text not showing up in inventories opened using plugins. Whilst looking through the source I saw the following line:

      player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, new ChatComponentText(title), size));

      Whilst the open window packet does support coloured text (it is a Chat field and not a string field), the text gets directly inserted in a new ChatComponentText instead of first parsing the old chat format (paragraph sign + code) using the already available methods in Bukkit! This code is stated in:

      CraftHumanEntity#openCustomInventory(Inventory, EntityPlayer, String)

      The fix is by changing that line to something like the following:

      player.playerConnection.sendPacket(new PacketPlayOutOpenWindow(container.windowId, windowType, CraftChatMessage.fromString(title)[0], size));

            Unassigned Unassigned
            Remceau Remco van Hooff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: