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

If you pre-populate a signs text for a player upon placement the sign becomes un-editable...

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • General plugin development

    • This server is running CraftBukkit version git-Spigot-f823ac5-dcb43ef (MC: 1.13.1) (Implementing API version 1.13.1-R0.1-SNAPSHOT)
    • none specifically
    • Yes

      Given the following code:

      @EventHandler
      public static void onBlockPlace(BlockPlaceEvent e)
      {
      		if(e.getBlockPlaced().getType() == Material.WALL_SIGN)
      		{
      			Sign s = (Sign) e.getBlockPlaced().getState();
      			s.setLine(1, "NewShop");
      			s.setLine(0, "[Buy:Sell]");
      			s.update();
      		}		}
      

       

      the sign is placed and the interface comes up for the player where they can enter their sign text..   This pre-populates the sign text.   However if you change the text then click done the text is not modified and the following warning is printed to the console.

      23.09 23:34:25 [Server] WARN Player dniym just tried to change non-editable sign

       

      This also seems to have the side effect of preventing a SignChangeEvent from firing.

      	
      @EventHandler
      public static void onSignEdit(SignChangeEvent e ) {
      		System.out.println("Edited a sign");
      	
      }
      

      If the sign is NOT pre-populated the sign change event fires as expected however it does not fire if the sign is populated on block place, regardless of if the text was edited by the placing player or not.

            Unassigned Unassigned
            whoolieshop Shane Martin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: