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

sendSignChange() has no effect on 1.20.5

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • macOS Sonoma 14.4.1 + Java 21 + Spigot API 1.20.5 from maven

    • This server is running CraftBukkit version 4102-Spigot-b698b49-8b4abeb (MC: 1.20.5) (Implementing API version 1.20.5-R0.1-SNAPSHOT)
    • Yes

      Follow up to https://hub.spigotmc.org/jira/browse/SPIGOT-7622. As of latest 1.20.5 spigot build, we no longer throw an exception but the sign does not actually get changed. Same code does change the sign on 1.20.4.

       

      Here is the code used to obtain the sign object from PlayerInteractEvent:

       
       

      if (currTranslator.getTranslatingSign()
      && event.getClickedBlock() != null
      && event.getClickedBlock().getType().name().contains("SIGN")
      && checkInventoryHand(event)
      && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
      
      /* Start sign translation */
      Sign currentSign = (Sign) event.getClickedBlock().getState();
      ...  

       
      This seems to work as expected on 1.20.4 and 1.20.5; if the sign was null I don't call sendSignChange().
       
      After getting the sign object, I use the following code once again:
       

      // Sign currentSign = (Sign) event.getClickedBlock().getState(); (above) 
      String[] signText = currentSign.getLines(); 
      String[] changedSignText = new String[signText.length]; 
      Location currLoc = currentSign.getLocation(); 
      boolean textLimit = false;
       
      /* Send message */
      refs.sendFancyMsg("wwcSignTranslateStart", "", "&d&l", event.getPlayer());
      /* Translate each line of sign */
      for (int i = 0; i < changedSignText.length; i++) {
       String eaLine = refs.translateText(signText[i], event.getPlayer()); 
       changedSignText[i] = eaLine; 
      }
       
      event.getPlayer().sendSignChange(currLoc, changedSignText);
      

       
      The rest of the code remains unchanged. My plugin successfully sets the changedSignText obj (and this code works on a downgrade.)

            md_5 md_5
            dominicfel1 Dominic Feliton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: