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

SPIGOT-10280: Implement EntityRemoveFromWorldEvent to enhance entity removal tracking #11474

Closed
wants to merge 2 commits into from

Conversation

namanONcode
Copy link

Description:
This pull request implements the EntityRemoveFromWorldEvent, which enhances tracking of entity removal in the game. This new event allows better monitoring of entity removal processes, providing more flexibility for plugin developers.

Key Changes:
Created EntityRemoveFromWorldEvent class to represent the removal of entities from the world.
Added various causes for entity removal such as DEATH, DESPAWN, DROP, etc.
Introduced an event listener system to trigger actions when an entity is removed.
JIRA Ticket:
Resolves SPIGOT-10280: Link to the JIRA Ticket (if applicable)

…tracking

- Added EntityRemoveFromWorldEvent class for monitoring when entities are removed from the world.
- Defined a Cause enum for various removal reasons: DEATH, DESPAWN, DROP, ENTER_BLOCK, EXPLODE, HIT, MERGE, OUT_OF_WORLD, PICKUP, PLUGIN, TRANSFORMATION, UNLOAD, OTHER.
- Included an inner EntityRemoveEvent class with a trigger method for handling removal actions.
- Implemented EntityRemoveListener for event handling.
- Created EntityManager to manage entity removal and dispatch events.

Related to SPIGOT-10280.
…tracking

- Added EntityRemoveFromWorldEvent class for monitoring when entities are removed from the world.
- Defined a Cause enum for various removal reasons: DEATH, DESPAWN, DROP, ENTER_BLOCK, EXPLODE, HIT, MERGE, OUT_OF_WORLD, PICKUP, PLUGIN, TRANSFORMATION, UNLOAD, OTHER.
- Included an inner EntityRemoveEvent class with a trigger method for handling removal actions.
- Implemented EntityRemoveListener for event handling.
- Created EntityManager to manage entity removal and dispatch events.

Related to SPIGOT-10280.
@namanONcode namanONcode requested a review from a team as a code owner October 6, 2024 19:37
@masmc05
Copy link
Contributor

masmc05 commented Oct 6, 2024

  1. Usually the upstream is updated by paper team
  2. Most probably this event needs to be deprecated in favour of already established api https://jd.papermc.io/paper/1.21.1/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.html

@Doc94
Copy link
Contributor

Doc94 commented Oct 6, 2024

Yeah Paper recommed use the EntityRemoveFromWorldEvent, the only "issue" is how you cannot know why the entity was removed.. for this exists #10149

@lynxplay
Copy link
Contributor

lynxplay commented Oct 6, 2024

As stated, upstream update as reserved for the team.

@lynxplay lynxplay closed this Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

5 participants