Swing arm and broken entity component - #3648
Conversation
|
If you could |
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 |
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. |
|
ah i see what you are building to now |
| fn loadFrom(zon: ZonElement) !void { | ||
| try super.loadFrom(id, zon, .client, undefined); | ||
|
|
||
| main.entity.components.@"cubyz:swinging".client.put(super.id); |
There was a problem hiding this comment.
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.
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
| }; | ||
|
|
||
| if (selectedBlockPos) |selectedPos| { | ||
| var breaking = main.entity.components.@"cubyz:breaking".client.get(main.game.Player.id) orelse blk: { |
There was a problem hiding this comment.
Can this not be const?
There was a problem hiding this comment.
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
No description provided.