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

Running command /neoforge tags <registry> list could kick player when there are too many tags #1543

Closed
YocyCraft opened this issue Sep 15, 2024 · 3 comments · Fixed by #1546
Labels
1.21.1 Targeted at Minecraft 1.21.1 bug A bug or error

Comments

@YocyCraft
Copy link

YocyCraft commented Sep 15, 2024

Minecraft Version: {Minecraft version}

1.21.1

NeoForge Version: {NeoForge version. Version number, not latest/rb}

21.1.47

Logs: {Link(s) to GitHub Gist with full latest.log and/or crash report}

https://gist.github.com/YocyCraft/29d218b2409db9cf5d9d09cb48736635

Steps to Reproduce:

  1. Open ATM10 Modpack
  2. Run command /neoforge tags minecraft:items list
  3. Kicked off from the game

Description of issue:

There are too many tags of registry so the message returned from command is too long
屏幕截图 2024-09-15 220113

@YocyCraft YocyCraft added the triage Needs triaging and confirmation label Sep 15, 2024
@sciwhiz12 sciwhiz12 added bug A bug or error 1.21.1 Targeted at Minecraft 1.21.1 and removed triage Needs triaging and confirmation labels Sep 15, 2024
@HenryLoenwind
Copy link
Contributor

While the result is paginated, there's a clickable element that copies ALL tag names to the clipboard. This is most likely what's overflowing.

final String allElementNames = names.get().sorted().collect(Collectors.joining("\n"));
...
.withClickEvent(new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, allElementNames))

@sciwhiz12
Copy link
Member

Confirmed. As @HenryLoenwind shows, the /neoforge tags commands have a feature to copy all items across all pages (for listing tags of a registry, tags of an element, or elements of a tag) to the clipboard. For a huge amount of tags, that click event text exceeds the limit for encoding strings in packets.

I think, to keep it functional for most use cases but handle obscenely large lists, we will simply limit the copy-to-clipboard text to some reasonable limit of entries (with a message that it is a truncated list at the start and end). Assuming a size of 32 characters per tag key, that fits about 1,024 elements, which we'll just round down to 1,000.

Perhaps we can consider a new /neoforge dump sub-command for specifically dumping tag-related entries?

@neoforged-releases
Copy link

🚀 This issue has been resolved in NeoForge version 21.3.35-beta, as part of #1546.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1 bug A bug or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants