Skip to content

Swing arm and broken entity component - #3648

Merged
IntegratedQuantum merged 15 commits into
PixelGuys:masterfrom
Wunka:swing_arm
Oct 4, 2026
Merged

IntegratedQuantum merged 15 commits into
PixelGuys:masterfrom
Wunka:swing_arm

Conversation

@Wunka

@Wunka Wunka commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Wunka Wunka moved this to Easy to Review in PRs to review Sep 29, 2026
@Wunka Wunka changed the title Swing arm entity component Swing arm and broken entity component Sep 29, 2026
@Wunka Wunka mentioned this pull request Sep 29, 2026
2 of 3 tasks
Comment thread src/entityComponent/_list.zig Outdated
Comment thread src/entityComponent/_list.zig Outdated
Comment thread src/entityComponent/swing_arm.zig Outdated
Comment thread src/server/server.zig Outdated
@Crepestrom

Copy link
Copy Markdown
Contributor

If you could
can you move as much of your code into a system as you can?

@Wunka

Wunka commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

If you could can you move as much of your code into a system as you can?

Will note this. This pr is already quite big (even though it doesn't do much) so I would do this as a follow up pr.

@Crepestrom

Copy link
Copy Markdown
Contributor

If you could can you move as much of your code into a system as you can?

Will note this. This pr is already quite big (even though it doesn't do much) so I would do this as a follow up pr.

ah oh well
i think this would simplify that a lot (currently its a massive code block)

@Wunka

Wunka commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

If you could can you move as much of your code into a system as you can?

Will note this. This pr is already quite big (even though it doesn't do much) so I would do this as a follow up pr.

ah oh well i think this would simplify that a lot (currently its a massive code block)

It will not simplify it... this is not just a code block. its logic that will stay either way. I already have simplifications though in mind. (which you can see in my actual progress draft #3649 and a system isn't even needed yet, because this is just the moving of where things are stored, it isn't even on the server, it only lives on the client. I will do simplifications refactoring etc, but not in the same pr.

@Crepestrom

Copy link
Copy Markdown
Contributor

ah i see what you are building to now

Comment thread src/entityComponent/breaking.zig Outdated
Comment thread src/renderer.zig Outdated
Comment thread src/renderer.zig Outdated
Comment thread src/renderer.zig Outdated
Comment thread src/game.zig Outdated
fn loadFrom(zon: ZonElement) !void {
try super.loadFrom(id, zon, .client, undefined);

main.entity.components.@"cubyz:swinging".client.put(super.id);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do kind of think that this is an odd place to have it. I can guarantee you that in the future whenever swinging is changed to be properly synced, this will linger here forgotten forever.
Because of that I would prefer if it was in the breakBlock function as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

true.. moved,

Wunka and others added 3 commits October 4, 2026 15:59
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Comment thread src/renderer.zig Outdated
};

if (selectedBlockPos) |selectedPos| {
var breaking = main.entity.components.@"cubyz:breaking".client.get(main.game.Player.id) orelse blk: {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can this not be const?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, you are right, its a pointer so I could just switch out the later getOrPut with a put and it will have the new data

@IntegratedQuantum
IntegratedQuantum merged commit 6eb49ec into PixelGuys:master Oct 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants