Here is an example how to open the sign editor.
import net.minecraft.server.v1_16_R1.BlockPosition;
import net.minecraft.server.v1_16_R1.PacketPlayOutOpenSignEditor;
import org.bukkit.Location;
import org.bukkit.block.Sign;
import org.bukkit.craftbukkit.v1_16_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
public class MojangReproductionTest {
//Sign s has already text on every line. However, the sign editor displays a blank sign instead of showing the existing text.
public static void openSignEditor(Player player, Sign s) {
Location l = s.getLocation();
BlockPosition position = new BlockPosition(l.getBlockX(), l.getBlockY(), l.getBlockZ());
PacketPlayOutOpenSignEditor packet = new PacketPlayOutOpenSignEditor(position);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
}
}
This worked fine in the past and is really annoying when just switching servers in a network now...
Would be awesome if this could get resolved.