Hello! I have a plugin that changes sign text with sendSignChange().
The following code works on 1.20.4, but fails on 1.20.5:
Sign currentSign = (Sign) event.getClickedBlock().getState(); 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);
Full stacktrace:
[14:52:38] [Server thread/WARN]: java.lang.NullPointerException: Cannot invoke "net.minecraft.world.level.World.H_()" because the return value of "net.minecraft.world.level.block.entity.TileEntity.i()" is null [14:52:38] [Server thread/WARN]: at net.minecraft.network.protocol.game.PacketPlayOutTileEntityData.a(SourceFile:30) [14:52:38] [Server thread/WARN]: at net.minecraft.network.protocol.game.PacketPlayOutTileEntityData.a(SourceFile:35) [14:52:38] [Server thread/WARN]: at net.minecraft.world.level.block.entity.TileEntitySign.l(TileEntitySign.java:323) [14:52:38] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer.sendSignChange(CraftPlayer.java:814) [14:52:38] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer.sendSignChange(CraftPlayer.java:789) [14:52:38] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R4.entity.CraftPlayer.sendSignChange(CraftPlayer.java:784) [14:52:38] [Server thread/WARN]: at com.badskater0729.worldwidechat.listeners.TranslateInGameListener$3$1.run(TranslateInGameListener.java:233) [14:52:38] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R4.scheduler.CraftTask.run(CraftTask.java:82) [14:52:38] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_20_R4.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415) [14:52:38] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1397) [14:52:38] [Server thread/WARN]: at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:402) [14:52:38] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1293) [14:52:38] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:1064) [14:52:38] [Server thread/WARN]: at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:311) [14:52:38] [Server thread/WARN]: at java.base/java.lang.Thread.run(Thread.java:1583)
(TranslateInGameListener 233 is just the sendSignChange() line above, for context)