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

Problems that prevent me from generating packets in C# #899

Open
Titlehhhh opened this issue Jul 23, 2024 · 1 comment
Open

Problems that prevent me from generating packets in C# #899

Titlehhhh opened this issue Jul 23, 2024 · 1 comment

Comments

@Titlehhhh
Copy link

I am in the process of building a library to work with the minecraft protocol in c#. Like all libraries, I need support for all minecraft packets, so I decided to generate them using this repository. While reading protodef I noticed a few issues that prevent me from fully generating packets:

  1. The Slot type has an anonymous field and a present field, when it would be possible to make the Slot type just optional container:
{
  "slot": [
    "optional",
    [
      "container",
      [
        {
          "name": "itemId",
          "type": "varint"
        },
        {
          "name": "itemCount",
          "type": "i8"
        },
        {
          "name": "nbtData",
          "type": "optionalNbt"
        }
      ]
    ]
  ]
}
  1. On version 1.13.X there is a tags type in the play.toClient namespace, which is supposed to be declared at the beginning, i.e. in types. This does not contradict protodef, but it is not uniform.

  2. Switch constructs sometimes have cases that are objects(container) and don't have a name, just a number.
    image

  3. Old versions had the type nbt, now it is called anonymousNbt. Why it was necessary to change the name is unclear.

Question: can I rely on these problems being fixed, or should I choose another way to generate packets?

@wgaylord
Copy link
Contributor

wgaylord commented Jul 24, 2024

I can explain number 4. anonymousNbt is its own type, introduced in new versions where the root tag does not send a tag name. So in 1.13 it is still normal nbt since root tags require names in that verison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants