NeoForge icon indicating copy to clipboard operation
NeoForge copied to clipboard

Add ServerEntitySendDirtyEntityDataEvent

Open TT432 opened this issue 1 year ago • 6 comments

This event is added because there is a need to publish reliable entity data synchronization packets over the network by listening to the sendDirtyEntityData method of the ServerEntity.

TT432 avatar Aug 12 '24 19:08 TT432

  • [ ] Publish PR to GitHub Packages

Can you fill out the description here with why this event is needed and problem it solves for what use case?

TelepathicGrunt avatar Aug 12 '24 19:08 TelepathicGrunt

How is this different from an EntityTickEvent.Post listener checking for dirty data and sending the custom packet?

With different frequencies, behavior is closer to the vanilla.

TT432 avatar Aug 12 '24 22:08 TT432

Is this for modded entities or for attaching to vanilla entities and entities from other mods?

If it's the former, a callback to a method in IEntityExtension would be cheaper than posting an event. For the latter, yes, an event is the right thing.

HenryLoenwind avatar Aug 13 '24 06:08 HenryLoenwind

Is this for modded entities or for attaching to vanilla entities and entities from other mods?

If it's the former, a callback to a method in IEntityExtension would be cheaper than posting an event. For the latter, yes, an event is the right thing.

for all entities

TT432 avatar Aug 13 '24 06:08 TT432

With different frequencies, behavior is closer to the vanilla.

I'm not totally sure what you mean by this, but the timing difference between the event you are adding and the existing tick event is irrelevant for network sync, the packets are handled completely separately on the client anyway. Can you give a more detailed explanation why you need it to fire specifically from this place instead of a generic entity tick event handler?

XFactHD avatar Aug 13 '24 12:08 XFactHD

I do not believe this event provides any functionality that cannot be accomplished via the EntityTickEvent.

Shadows-of-Fire avatar Sep 27 '24 03:09 Shadows-of-Fire