-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add EntityExtinguishEvent #9610
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
| From: Aurora <aurora@relanet.eu> | ||
| Date: Sat, 20 Mar 2021 18:14:24 +0100 | ||
| Subject: [PATCH] Add EntityExtinguishEvent | ||
|
|
||
|
|
||
| diff --git a/src/main/java/io/papermc/paper/event/entity/EntityExtinguishEvent.java b/src/main/java/io/papermc/paper/event/entity/EntityExtinguishEvent.java | ||
| new file mode 100644 | ||
| index 0000000000000000000000000000000000000000..cbeeb9f52e7886e4561b6e575a944ed0a78898c7 | ||
| --- /dev/null | ||
| +++ b/src/main/java/io/papermc/paper/event/entity/EntityExtinguishEvent.java | ||
| @@ -0,0 +1,84 @@ | ||
| +package io.papermc.paper.event.entity; | ||
| + | ||
| +import org.bukkit.entity.Entity; | ||
| +import org.bukkit.event.Cancellable; | ||
| +import org.bukkit.event.HandlerList; | ||
| +import org.bukkit.event.entity.EntityEvent; | ||
| +import org.jetbrains.annotations.ApiStatus; | ||
| +import org.jetbrains.annotations.NotNull; | ||
| + | ||
| +/** | ||
| + * Called when a burning {@link Entity} is extinguished. | ||
| + */ | ||
| +public class EntityExtinguishEvent extends EntityEvent implements Cancellable { | ||
| + private static final HandlerList HANDLER_LIST = new HandlerList(); | ||
| + private final Cause cause; | ||
| + private boolean cancelled; | ||
| + | ||
| + @ApiStatus.Internal | ||
| + public EntityExtinguishEvent(final @NotNull Entity entity, final @NotNull Cause cause) { | ||
| + super(entity); | ||
| + this.cause = cause; | ||
| + } | ||
| + | ||
| + @NotNull | ||
| + public Cause getCause() { | ||
| + return cause; | ||
| + } | ||
| + | ||
| + @Override | ||
| + public void setCancelled(boolean cancelled) { | ||
| + this.cancelled = cancelled; | ||
| + } | ||
| + | ||
| + @Override | ||
| + public boolean isCancelled() { | ||
| + return this.cancelled; | ||
| + } | ||
| + | ||
| + public enum Cause { | ||
| + /** | ||
| + * Extinguish caused by entity standing in water. | ||
| + */ | ||
| + WATER, | ||
| + /** | ||
| + * Extinguish caused by entity standing in the rain. | ||
| + */ | ||
| + RAIN, | ||
| + /** | ||
| + * Extinguish caused by entity standing in a bubble column. | ||
| + */ | ||
| + BUBBLE_COLUMN, | ||
| + /** | ||
| + * Extinguish caused by entity standing in a cauldron with water. | ||
| + */ | ||
| + CAULDRON, | ||
| + /** | ||
| + * Extinguish caused by entity dying. | ||
| + */ | ||
| + DEATH, | ||
| + /** | ||
| + * Extinguish caused by fire ticks running out. | ||
| + */ | ||
| + TIME, | ||
| + /** | ||
| + * Extinguish caused by standing in powdered snow. | ||
| + */ | ||
| + POWDER_SNOW, | ||
| + /** | ||
| + * Extinguish caused by being splashed with a water bottle. | ||
| + */ | ||
| + WATER_BOTTLE | ||
| + } | ||
| + | ||
| + @Override | ||
| + @NotNull | ||
| + public HandlerList getHandlers() { | ||
| + return HANDLER_LIST; | ||
| + } | ||
| + | ||
| + @NotNull | ||
| + public static HandlerList getHandlerList() { | ||
| + return HANDLER_LIST; | ||
| + } | ||
| +} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.