GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.75k stars 687 forks source link

Virtual lectern does not work #5139

Open KabanFriends opened 1 week ago

KabanFriends commented 1 week ago

Describe the bug

When showing a lectern GUI of a lectern that does not exist in the world, bedrock players don't see the book text.

To Reproduce

  1. Run a code like this to open a virtual lectern GUI:
    Inventory inv = Bukkit.createInventory(null, InventoryType.LECTERN);
    ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
    BookMeta bookMeta = (BookMeta) book.getItemMeta();
    bookMeta.addPage("Example Page Text");
    bookMeta.setTitle("Example Title");
    bookMeta.setAuthor("Sigong");
    book.setItemMeta(bookMeta);
    inv.setItem(0, book);
    player.openInventory(inv);
  2. Observe the text in the book

Expected behaviour

Bedrock players can see the text "Example Page Text" correctly

Screenshots / Videos

image

Server Version and Plugins

No response

Geyser Dump

https://dump.geysermc.org/HlvLXuJ81Kd6Eb3zHAMo0pnpjT0Vxs0Z

Geyser Version

2.5.0-b711 (git-master-4598ffe)

Minecraft: Bedrock Edition Device/Version

1.21.41, Windows 11

Additional Context

This is the plugin I quickly wrote to reproduce the bug: TestPlugin.zip Type /books in chat to see the virtual lectern GUI.