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

feat: middle mouse to select blocks in build mode #23

Open
wants to merge 1 commit into
base: 1.21
Choose a base branch
from

Conversation

sekwah41
Copy link
Member

No description provided.

Copy link
Member

@Gegy Gegy left a comment

Choose a reason for hiding this comment

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

Ooh, thanks so much for implementing this! This is a much needed feature that we've left for too long 😄
I'm a bit hesitant to introducing the client-authoritative item picking here; if you're up for switching the approach, that would be fantastic :)


import java.util.List;

public record SetGamemodeBuildSlotPacket(short slotNum, ItemStack itemStack) implements CustomPacketPayload {
Copy link
Member

Choose a reason for hiding this comment

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

Although this is what creative mode does, and we do have filtering here (thanks for adding that in 😅), it would be really nice to avoid this kind of client -> server item request. Particularly, from experience of how flimsy this can be in creative mode already - and how dangerous sending an ItemStack client->server can be in general, for all the kinds of weirdly nested/recursive structures that can be constructed.

In the latest snapshots, this is something Vanilla actually handles totally server-driven - I think it shouldn't be too tricky to do a similar kind of thing, where the client just sends a "hey, pick this block for me" packet and the server does all the logic and tells the client about what item it gets. (Block entity serialisation on the client also is a bit of a scary one 😅)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh thats a good point and wouldnt be too tall a task to implement, Ill take a look later at switching it over to a blockpos rather than item stack target. Luckily the rest of the code can be kept the same :)

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