Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treasure maps and other maps with icons cause a DecoderException when decoded as an item #810

Closed
joshuaprince opened this issue Jun 1, 2024 · 2 comments · Fixed by #811
Labels
bug Something isn't working

Comments

@joshuaprince
Copy link
Contributor

Describe the bug
Reading any map that has an icon (most notably treasure maps) with wrappers such as WrapperPlayServerWindowItems kicks the player.

Client log:

[16:18:41] [Netty Epoll Client IO #13/ERROR]: Network Exception Caught
io.netty.handler.codec.DecoderException: Failed to decode packet 'clientbound/minecraft:container_set_content'
... truncated ...
Caused by: io.netty.handler.codec.DecoderException: Failed to decode: No key rotation in MapLike[{float:180.0f,type:"minecraft:red_x",x:-1399.0d,z:1545.0d}] missed input: {+:{float:180.0f,type:"minecraft:red_x",x:-1399.0d,z:1545.0d}} {+:{float:180.0f,type:"minecraft:red_x",x:-1399.0d,z:1545.0d}}

Software brand
Paper 1.20.6-130
PacketEvents 2.3.1-SNAPSHOT (rev 3352f25)

Plugins
Just PacketEvents, built from source with added wrapper

How To Reproduce

            public void onPacketPlaySend(PacketPlaySendEvent event) {
                if (event.getPacketType() == PacketType.Play.Server.WINDOW_ITEMS) {
                    WrapperPlayServerWindowItems w = new WrapperPlayServerWindowItems(event);
                    w.getItems();
                }
            }

Either find a shipwreck and open a chest that contains a treasure map, or give a map with an icon:

/give @s minecraft:map
[ explore the map ]
[ replace MAPID with the map ID just explored, and coordinates with your coordinates ]
/give @s minecraft:filled_map[minecraft:map_decorations={"a": {"type": "red_x", "x": MY_X, "z": MY_Z, "rotation": 0}}, minecraft:map_id=MAPID]

Log out and back in. Since the item is now in your inventory, it always kicks you on join until the WrapperPlayServerWindowItems is removed.

Expected behavior
No exception or kick.

Screenshots
N/A

Additional context
N/A

@joshuaprince joshuaprince added the bug Something isn't working label Jun 1, 2024
@booky10
Copy link
Collaborator

booky10 commented Jun 1, 2024

Which client version? Also 1.20.5/1.20.6?

joshuaprince added a commit to joshuaprince/packetevents that referenced this issue Jun 1, 2024
@joshuaprince
Copy link
Contributor Author

Which client version? Also 1.20.5/1.20.6?

Also 1.20.6. Turned out to be a pretty simple fix, #811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants