-
Notifications
You must be signed in to change notification settings - Fork 42
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
Implement all packets #85
Comments
нiхуя собi блять |
english? |
"I'm very surprised at this number of packets" culturally speaking |
me too my friend |
Welcome hacktoberfest people! A lot of packets are still unimplemented. Any help is very much welcome! |
UPDATE TO MATCH THE NEWEST PROTOCOL! |
Hi—what exactly is needed to implement a packet, from the perspective of a new contributor? Currently my understanding is client bound packets simply need correct fields & ordering, and serverbound need “handler” functions for updating server state. Are there any gotchas to contributing a packet that I’m missing? |
Hello @Mooshua! Thank you for taking interest in contributing. You already got the gist of it, clearly. There are some important things to keep in mind (that are perhaps, not intuitive): [Field(0), ActualType(byte)]
public MyEnum MyEnumValue { get; } // although it's an enum, it gets written as a byte [Field(0), VarLength]
public int VarInt { get; } // gets written as varint
[Field(1), VarLength]
public long VarLong { get; } // gets written as varlong [Field(0)]
public int[] Values { get; } // first Values.Length gets written as a varint, then the actual Values get written
[Field(1), CountType(typeof(short))]
public int[] Values { get; } // first Values.Length gets written as a short, then the actual Values get written When there is X, Y and Z coordinates in the packet, you don't have to make them separate fields, you can use
The packet would look like: [Field(0), DataFormat(typeof(float))]
public VectorF Position { get; } Sometimes, packet fields are only supposed to be written under some condition. You can use the [Field(0)]
public int ValidChangesCount { get; }
[Field(1), Condition("ValidChangesCount > 0")]
public int[] Changes { get; }
// Generates something like:
// if (ValidChangesCount > 0)
// {
// WriteIntArray(Changes);
// } You can view generated sserialization methods in Solution Explorer under Obsidian > Dependencies > Analyzers > Obsidian.SourceGenerators > Obsidian.SourceGenerators.Packets.Serialization. Happy coding! ⛄ |
Added priority: blocking as this is very important. Help is very much welcome. Will update list with wiki.vg in a bit. |
A checklist of packets that are yet to be implemented on master (ordered as on wiki.vg):
Clientbound
Serverbound
Login
The text was updated successfully, but these errors were encountered: