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

Entity Events module #42

Merged
merged 58 commits into from
Oct 5, 2022
Merged

Entity Events module #42

merged 58 commits into from
Oct 5, 2022

Conversation

williambl
Copy link
Contributor

@williambl williambl commented Oct 17, 2021

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 williambl marked this pull request as draft October 17, 2021 20:54
@i509VCB i509VCB added hacktoberfest-accepted new: library A pull request which adds a new library. new: module A pull request which adds a new module labels Oct 17, 2021
@williambl williambl marked this pull request as ready for review October 31, 2021 23:24
@williambl
Copy link
Contributor Author

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

@BasiqueEvangelist
Copy link
Contributor

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

@williambl
Copy link
Contributor Author

Going to rebase onto 1.18 and force push.

@williambl williambl changed the base branch from 1.17.1 to 1.18 November 19, 2021 22:58
@williambl williambl changed the title [WIP] Add Entity Events module [WIP] Entity Events module Nov 19, 2021
@williambl
Copy link
Contributor Author

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

@williambl
Copy link
Contributor Author

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

@BasiqueEvangelist
Copy link
Contributor

@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.

@TheGlitch76 TheGlitch76 mentioned this pull request Dec 4, 2021
4 tasks
@Platymemo Platymemo mentioned this pull request Jan 18, 2022
@LambdAurora LambdAurora added the library: entity Related to the entity library. label Jan 23, 2022
@LambdAurora LambdAurora added the t: new api This adds a new API. label Feb 18, 2022
@TheGlitch76
Copy link
Member

is this API still WIP?

@williambl williambl changed the title [WIP] Entity Events module Entity Events module Feb 26, 2022
@williambl
Copy link
Contributor Author

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)

Copy link
Contributor

@LambdAurora LambdAurora left a comment

Choose a reason for hiding this comment

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

Some of those events could be AwareListeners to allow them to be used in entrypoints.

Package also seems to be wrong: https://github.com/QuiltMC/quilt-standard-libraries/blob/1.18/CONTRIBUTING.md#packages

@TheGlitch76 TheGlitch76 dismissed i509VCB’s stale review March 18, 2022 02:06

i5 will not be re-reviewing

@williambl williambl changed the base branch from 1.18 to 1.19 April 15, 2022 19:05
Copy link
Contributor

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

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

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

williambl and others added 3 commits September 14, 2022 20:40
…ity_events/api/ServerPlayerEntityCopyCallback.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
…ity_events/api/LivingEntityDeathCallback.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
@williambl
Copy link
Contributor Author

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

Copy link
Contributor

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

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

I have a final barrage of nitpicks

williambl and others added 5 commits September 22, 2022 09:08
…ity_events/api/EntityReviveEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
…ity_events/api/EntityWorldChangeEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
…ity_events/api/EntityWorldChangeEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
…ity_events/api/EntityReviveEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
…ity_events/api/EntityWorldChangeEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
Copy link
Contributor

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

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

After months of work, I believe that this is finally ready!

@TheGlitch76 TheGlitch76 dismissed their stale review September 26, 2022 18:41

outdated; concerns adressed

@EnnuiL EnnuiL removed request for a team and LambdAurora September 26, 2022 19:19
Copy link
Contributor

@EnnuiL EnnuiL left a comment

Choose a reason for hiding this comment

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

Actually, no, I have a final objection

…ity_events/api/EntityReviveEvents.java

Co-authored-by: Ennui Langeweile <85590273+EnnuiL@users.noreply.github.com>
Copy link
Member

@OroArmor OroArmor left a comment

Choose a reason for hiding this comment

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

For such a large number of events, its surprising how few mixins are needed

@EnnuiL EnnuiL merged commit aa226fb into QuiltMC:1.19 Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
final-comment-period library: entity Related to the entity library. new: module A pull request which adds a new module t: new api This adds a new API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants