dmulloy2 / ProtocolLib

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

StreamSerializer deserializeItemStack throw error. #3206

Open MikuSnow opened 2 months ago

MikuSnow commented 2 months ago

in version 1.20.6 RegistryFriendlyByteBuf has no method "readItemStack"

Ingrim4 commented 2 months ago

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

MikuSnow commented 2 months 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);
            }

        }
    }