[SPIGOT-7626] sendSignChange() has no effect on 1.20.5 Created: 24/Apr/24  Updated: 25/Dec/24  Resolved: 24/Apr/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Dominic Feliton Assignee: md_5
Resolution: Fixed Votes: 0
Labels: 1.20.5, bug, spigot
Environment:

macOS Sonoma 14.4.1 + Java 21 + Spigot API 1.20.5 from maven


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

 Description   

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.)



 Comments   
Comment by md_5 [ 24/Apr/24 ]

Thanks, I've confirmed fixed

Comment by Dominic Feliton [ 24/Apr/24 ]

I actually run the sendSignChange() method in a call to the scheduler as sync task. The translation logic is ran async to avoid stalling the main thread. Do you want me to try running it without any scheduler logic, and just on the main thread?

Comment by md_5 [ 24/Apr/24 ]

I suspect it might be a block update triggered after the interact event. Perhaps something changed with that in 1.20.5. As a test ,you could see if the issue persists with a scheduler. This would be helpful in narrowing the bug.

Generated at Tue Apr 22 05:09:37 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.