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

When getting the block data from a sign(or wall_sign) there is no way to get the lines of the sign.

    XMLWordPrintable

Details

    • New Feature
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Invalid
    • None
    • None
    • Definitly 1.13-1.16 (but might be all versions)
    • Yes

    Description

      When retrieving a BlockData object (of type org.bukkit.block.data.type.Sign) from an Sign block(org.bukkit.block.Sign), the returned BlockData has no method to get or set the lines of the sign-data, even though this would be expected.
      Even wore(I assume this is a result of the previous issue) when the getAsString() method is used on the BlockData the line-information is not contained within the output and therefore completely inaccessible.

      //This basically serves as a minimal reproduction plugin.
      Block b = null; // Initialized with a valid sign-block
      BlockData blockData  = b.getBlockData();
      String blockDataString = blockData.getAsString();
      Bukkit.getLogger().info(blockDataString);
      

      This code logs:
      minecraft:oak_sign[rotation=0,waterlogged=false]

      while F3+I returns:
      /setblock -9 38 10 minecraft:oak_sign[rotation=0,waterlogged=false]{Color:"black",Text4:'{"extra":[

      {"text":"t4"}

      ],"text":""}',Text3:'{"extra":[

      {"text":"t3"}

      ],"text":""}',Text2:'{"extra":[

      {"text":"t2"}

      ],"text":""}',Text1:'{"extra":[

      {"text":"t1"}

      ],"text":""}'}

      Resolving this issue would also be a good opportunity to add an API to set click-actions for signs to, but that is by no means needed to resolve the bug addressed in this issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            MoritzR200 MoritzR200
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: