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

impl enums for v662 #68

Merged
merged 135 commits into from
Nov 23, 2024
Merged

Conversation

OmniacDev
Copy link
Member

No description provided.

@theaddonn
Copy link
Member

Something I noticed in general is that you are creating a new module/namespace quite often, that is unnecessary..
for example actor_block_sync_message::ActorBlockSyncMessage::MessageId gets quite long, Rust already creates a new module for every file, so you might want to remove the additional module in the file and rename the internal enum to something like ActorBlockSyncMessageId

@theaddonn
Copy link
Member

Also something to avoid in the future (only avoid this for stuff in the /enums and /types directory), having the word packet in the file/type name.. this may easily confuse people with the actual file for the packet :)

@theaddonn
Copy link
Member

Also, it is not that important to match Mojang's names 1:1 since they can be quite confusing at times

Copy link
Member

@theaddonn theaddonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So urm, this review got quite big....

@@ -0,0 +1,10 @@
pub mod ActorBlockSyncMessage {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the additional mod, you can just rename the type to ActorBlockSyncMessageId :)

@@ -0,0 +1,14 @@
pub mod AnimatePacket {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for the additional mod, you can just rename the type to AnimateAction :)

@@ -0,0 +1,14 @@
pub mod AnimatePacket {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, it is confusing when you add an extra packet in the file name, maybe change it to crates/proto/src/version/v662/enums/animate.rs

crates/proto/src/version/v662/enums/build_platform.rs Outdated Show resolved Hide resolved
crates/proto/src/version/v662/enums/build_platform.rs Outdated Show resolved Hide resolved
@@ -0,0 +1,8 @@
pub mod PositionTrackingDBClientRequestPacket {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to remove the extra mod and just call the enum PositionTrackingDBClientRequestAction

@@ -0,0 +1,10 @@
pub mod PositionTracingDBServerBroadcastPacket {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to remove the extra mod and just call the enum PositionTracingDBServerBroadcastAction

@@ -0,0 +1,10 @@
pub mod PositionTracingDBServerBroadcastPacket {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make sense to also merge this with position_tracking_db_client_request_packet.rs into one file called position_tracking_db.rs

@@ -0,0 +1,63 @@
pub mod MinecraftEventing {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know what to say here, this is a true mess and idk what happened

Just maybe remove the extra mod and get each enum a separate file.. I guess

@@ -0,0 +1,460 @@
pub mod Puv {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like quite a lot of module nesting... why dont you just call the enum LegacyLevelSoundEvent.. adjust the file name and remove the other mods?

@OmniacDev
Copy link
Member Author

Something I noticed in general is that you are creating a new module/namespace quite often, that is unnecessary..
for example actor_block_sync_message::ActorBlockSyncMessage::MessageId gets quite long, Rust already creates a new module for every file, so you might want to remove the additional module in the file and rename the internal enum to something like ActorBlockSyncMessageId

Yeah this was sort of temporary until I can find the other stuff in the namespace, types& packets etc. I added comments in the mod.rs file for all the modules in there so I can easily go back and change them later

@OmniacDev
Copy link
Member Author

these workflows are annoying lmao, spamming my email every time I push

@OmniacDev
Copy link
Member Author

@theaddonn I might leave this as is for now, planning on coming back later after implementing all the types and packets to clean everything up.

@theaddonn
Copy link
Member

Sounds good!

@theaddonn theaddonn merged commit 3e258f1 into bedrock-crustaceans:proto_rework Nov 23, 2024
2 of 4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants