quilt-standard-libraries icon indicating copy to clipboard operation
quilt-standard-libraries copied to clipboard

Entity Events module

Open williambl opened this issue 2 years ago • 12 comments

This PR adds:

  • A new library, entity (as described in RFC #9)
  • A new module, entity_events
  • A set of events in that module.
  • A test mod for that module.

The events included are:

  • EntityKilledCallback, with similar purpose to Fabric's AfterKilledOtherEntity.
  • TryReviveCallback - the AllowDeathEvent I wrote for FAPI was merged in a state I was unhappy with. This is closer to how I imagined it.
  • EntityWorldChangedEvents - unchanged from FAPI's ServerEntityWorldChangedEvents, other than name.
  • EntityLoadEvents, two events for when entities are loaded and unloaded on the server.
  • ClientEntityLoadEvents, ditto but for the client.
  • ServerPlayerEntityCopyCallback, for copying data after player respawn.

There is certainly space for more events.

williambl avatar Oct 17 '21 20:10 williambl

marking as ready for review just for hacktoberfest, sorry :(

williambl avatar Oct 31 '21 23:10 williambl

Could you add events for copying player data on respawn and travel from end?

BasiqueEvangelist avatar Nov 14 '21 10:11 BasiqueEvangelist

Going to rebase onto 1.18 and force push.

williambl avatar Nov 19 '21 22:11 williambl

Not sure why checks are failing, they're passing locally

williambl avatar Nov 21 '21 23:11 williambl

@BasiqueEvangelist added ServerPlayerEntityCopyCallback (name subject to change because that's quite long) - does this fit what you'd need?

williambl avatar Nov 22 '21 01:11 williambl

@BasiqueEvangelist added ServerPlayerEntityCopyCallback (name subject to change because that's quite long) - does this fit what you'd need?

This seems to fit all common use cases, so yes.

BasiqueEvangelist avatar Nov 23 '21 14:11 BasiqueEvangelist

is this API still WIP?

TheGlitch76 avatar Feb 24 '22 01:02 TheGlitch76

is this API still WIP?

There are a couple more events to be added, but I think I'd be happy to merge these existing ones as-is. (with the caveat that I'd like someone to have a look at the the tryrevive events and see if they can be done with the event phase system, which I'm having trouble wrapping my head around)

williambl avatar Feb 26 '22 15:02 williambl

rebasing onto 1.19

williambl avatar Apr 15 '22 19:04 williambl

unrebasing back onto 1.18, i wasn't thinking straight

williambl avatar Apr 15 '22 19:04 williambl

Should this be rebased onto 1.19?

williambl avatar Jul 11 '22 12:07 williambl

Should this be rebased onto 1.19?

I might be a bit biased on that, but yeah, considering that Registry Sync is pretty much almost done, with it hopefully getting on the road of a possible FCP, I think we can begin bumping the remaining PRs to 1.19

EnnuiL avatar Jul 11 '22 20:07 EnnuiL

rebased onto 1.19. not yet tested on 1.19.

williambl avatar Sep 03 '22 11:09 williambl

not sure why it auto-requested review from worldgen gui and data teams...

williambl avatar Sep 03 '22 11:09 williambl

This has now been tested on 1.19.

williambl avatar Sep 07 '22 13:09 williambl

We're almost there! With the Checkstyle clean-ups, I could spot few potential problems

All addressed I think - maybe this'll get merged before its birthday! :P

williambl avatar Sep 14 '22 20:09 williambl