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

Implement all packets #85

Open
34 of 77 tasks
Seb-stian opened this issue Feb 7, 2021 · 10 comments
Open
34 of 77 tasks

Implement all packets #85

Seb-stian opened this issue Feb 7, 2021 · 10 comments
Labels
enhancement New feature or request epic Very cool hacktoberfest Issues for hacktoberfest people! help wanted Extra attention is needed priority: blocking Blocking; must be prioritized server Relates to the server implementation

Comments

@Seb-stian
Copy link
Member

Seb-stian commented Feb 7, 2021

A checklist of packets that are yet to be implemented on master (ordered as on wiki.vg):

Clientbound

  • Spawn Experience Orb #222
  • Spawn Painting
  • Statistics
  • Block Entity Data
  • Server Difficulty
  • Set Cooldown
  • Explosion
  • Tab Complete
  • Window Property
  • Disconnect
  • Entity Status
  • Open Horse Window
  • Effect
  • Implement Update Light client packet #67
  • Map Data
  • Trade List
  • Vehicle Move
  • Open Book
  • Open Sign Editor
  • Player Abilities
  • Combat Event
  • Face Player
  • Player Position And Look
  • Remove Entity Effect
  • Resource Pack Send
  • Respawn
  • Entity Head Look
  • Multi Block Change
  • Select Advancement Tab
  • World Border
  • Camera
  • Held Item Change
  • Update View Distance
  • Attach Entity
  • Set Experience
  • Update Health
  • Set Passengers
  • Teams
  • Time Update
  • Title
  • Entity Sound Effect
  • Stop Sound
  • NBT Query Response
  • Advancements
  • Entity Properties
  • Entity Effect
  • Declare Recipes

Serverbound

  • Query Block NBT
  • Query Entity NBT
  • Set Difficulty
  • Client Status
  • Tab Complete
  • Edit Book
  • Interact Entity
  • Generate Structure
  • Lock Difficulty
  • Player Position And Rotation
  • Player Movement
  • Vehicle Move
  • Steer Boat
  • Player Abilities
  • Steer Vehicle
  • Set Recipe Book State
  • Resource Pack Status
  • Advancement Tab
  • Select Trade
  • Set Beacon Effect
  • Held Item Change
  • Update Command Block
  • Update Command Block Minecart
  • Update Jigsaw Puzzle
  • Update Structure Block
  • Update Sign
  • Spectate
  • Use Item

Login

  • Login Plugin Request
  • Login Plugin Response
@roxxel
Copy link
Contributor

roxxel commented Feb 7, 2021

нiхуя собi блять

@Naamloos
Copy link
Member

Naamloos commented Feb 7, 2021

english?

@Naamloos Naamloos added enhancement New feature or request epic Very cool help wanted Extra attention is needed labels Feb 7, 2021
@roxxel
Copy link
Contributor

roxxel commented Feb 7, 2021

english?

"I'm very surprised at this number of packets" culturally speaking

@Naamloos
Copy link
Member

Naamloos commented Feb 7, 2021

me too my friend

@Naamloos
Copy link
Member

Naamloos commented Mar 9, 2021

image
fucken excuse me?!

@Naamloos Naamloos self-assigned this Mar 9, 2021
@Seb-stian Seb-stian added the server Relates to the server implementation label Apr 20, 2021
@Naamloos Naamloos added the hacktoberfest Issues for hacktoberfest people! label Oct 23, 2021
@Naamloos
Copy link
Member

Welcome hacktoberfest people! A lot of packets are still unimplemented. Any help is very much welcome!

@Seb-stian
Copy link
Member Author

UPDATE TO MATCH THE NEWEST PROTOCOL!

@Mooshua
Copy link

Mooshua commented Dec 24, 2021

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?
Thanks.

@Seb-stian
Copy link
Member Author

Seb-stian commented Dec 24, 2021

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 Vector or VectorF (for float/double) with [DataFormat(typeof(...))]. So for example if a packet looked like:

Field Type
X float
Y float
Z float

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 [Condition] attribute for that.

[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! ⛄

@Naamloos Naamloos removed their assignment Jan 9, 2022
@Naamloos Naamloos added the priority: blocking Blocking; must be prioritized label Jan 9, 2022
@Naamloos
Copy link
Member

Naamloos commented Jan 9, 2022

Added priority: blocking as this is very important. Help is very much welcome. Will update list with wiki.vg in a bit.

Czompi added a commit to Czompi/Obsidian that referenced this issue Jan 12, 2022
Czompi added a commit to Czompi/Obsidian that referenced this issue Jan 12, 2022
Czompi added a commit to Czompi/Obsidian that referenced this issue Jan 13, 2022
@Craftplacer Craftplacer changed the title Implement all packets all Apr 18, 2022
@Seb-stian Seb-stian changed the title all Implement all packets Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request epic Very cool hacktoberfest Issues for hacktoberfest people! help wanted Extra attention is needed priority: blocking Blocking; must be prioritized server Relates to the server implementation
Projects
Status: In progress
Development

No branches or pull requests

4 participants