[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(); ... // 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); |
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. |