dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
1.02k stars 260 forks source link

StreamSerializer deserializeItemStack throw error. #3206

Open MikuSnow opened 2 weeks ago

MikuSnow commented 2 weeks ago

in version 1.20.6 RegistryFriendlyByteBuf has no method "readItemStack"

Ingrim4 commented 2 weeks ago

Can you please provide more details about your issue. (e.g. errors, a /protocol dump file, logs, etc.)

MikuSnow commented 2 weeks ago

Can you please provide more details about your issue. (e.g. errors, a /protocol dump file, logs, etc.)

The logs: https://pastebin.com/xrJcjyn6 The dump: https://pastebin.com/29hb6pGv

The test code:

    @EventHandler
    public void onPlayerJoin(@NotNull PlayerJoinEvent event) {
        Player player = event.getPlayer();
        for (@Nullable ItemStack storageContent : player.getInventory().getStorageContents()) {
            System.out.println("#1");
            try {
                System.out.println("#2");
                String s = StreamSerializer.getDefault().serializeItemStack(storageContent);
                System.out.println("#3");
                System.out.println(s);
            } catch (IOException e) {
                System.out.println("#4");
                throw new RuntimeException(e);
            }

        }
    }